-
-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
403 Error when scraping images #211
Comments
Hey @alfkoblischke have you tried setting a browser agent? Peter |
Hi Peter, `require_once './vendor/autoload.php'; use Spekulatius\PHPScraper\PHPScraper; $web = new PHPScraper; $sharingImage = $web->fetchAsset($url);` And the following Error: "Fatal error: Uncaught Symfony\Component\HttpClient\Exception\ClientException: HTTP/2 403 returned for "https://www.allianz.de/content/dam/onemarketing/azde/azd/newsletter/images/august-2024/lp3/newsletter-august-teaser-600x600-wohnwagenversicherung-lp3.jpg...."" The strange thing is, that i can call the url in the browser and it works there. Alf |
hmm, I guess the site does validate the request against further criteria. You probably want to look at the other headers send over with the request. Copying the request from the browser console as curl, then striping the things away until it breaks might help |
I have a problem with some Image-URLS and get a 403 Error. It is no problem to call the URL in the Browser - that works perfectly.
Can anybody help? URL: [https://www.allianz.de/content/dam/onemarketing/azde/azd/newsletter/images/august-2024/lp3/newsletter-august-teaser-600x600-wohnwagenversicherung-lp3.jpg]
The text was updated successfully, but these errors were encountered: