crawlee-python icon indicating copy to clipboard operation
crawlee-python copied to clipboard

Add support for `preNavigationHooks` in Playwright

Open viewv opened this issue 1 year ago • 4 comments

As the title, I want to know does the crawlee-python support the preNavigationHooks function?

viewv avatar Aug 13 '24 11:08 viewv

Hello and thanks for your interest in Crawlee for Python! Pre-navigation hooks are not currently supported. Before we implement this, would putting the hook code into the request handler help? Or do you need to do something before the page is loaded?

janbuchar avatar Aug 13 '24 13:08 janbuchar

Hello and thanks for your interest in Crawlee for Python! Pre-navigation hooks are not currently supported. Before we implement this, would putting the hook code into the request handler help? Or do you need to do something before the page is loaded?

OK, thank you, I want to change some browser properties before the page loaded, so I think it will be really helpful to support the preNavigationHooks.

viewv avatar Aug 13 '24 13:08 viewv

I want to do something before the page loads, such as aborting when loading some images or CSS, Is there any trick available to achieve this as of now?

Tallone avatar Aug 23 '24 03:08 Tallone

Implementation from Crawlee JS:

vdusek avatar Sep 25 '24 13:09 vdusek

@vdusek /assign

Yashwanth-Chandrakumar avatar Oct 18 '24 05:10 Yashwanth-Chandrakumar

@vdusek /assign

We don't assign issues for hacktoberfest. If you want to contribute, open a PR whenever you're ready. First mergeable one gets merged.

janbuchar avatar Oct 18 '24 06:10 janbuchar

@janbuchar Thanks Mate

Yashwanth-Chandrakumar avatar Oct 18 '24 12:10 Yashwanth-Chandrakumar

@janbuchar i have created a PR to solve the issue please view it #602

Yashwanth-Chandrakumar avatar Oct 19 '24 04:10 Yashwanth-Chandrakumar