Closed AliHassan89 closed 9 months ago
I see two issues here:
wait_for_selector
methods are failing, I assume because those elements never appear, they seem randomly generated so I'm not sure it's a good idea to rely on them. This results in a playwright._impl._api_types.TimeoutError
exception that is silently swallowed by your errback: the response is not empty, what happens is that the parse
method is not called.PLAYWRIGHT_LAUNCH_OPTIONS = {"headless": False}
) I'm seeing a cookies confirmation form and a holiday promo modal, only after closing those the page allows the scrolling.You can access the response in your errback to verify it contains full HTML with failure.response
. For instance:
async def close_page(self, failure):
...
with open("page.html", "w") as fp:
fp.write(failure.response.text)
In any case, this is a support question and not a bug report or feature request. If you need further assistance please use a more appropriate place, e.g. the scrapy-playwright tag at StackOverflow.
I have the following code. It opens up the headless browser and I also see the page getting scrolled but the response object in parse method doesn't have any HTML. When I don't use auto-scrolling this spider works perfectly.
The code is supposed only to extract the product name and product price from this website.