Repository navigation
feat: Add example of how to integrate Camoufox into PlaywrightCrawler - #789
Conversation
Fix inccorect indent in existing project template.
janbuchar
left a comment
There was a problem hiding this comment.
Nice job! I'm not sure about the docs prefix though - we also fix a bug in templates and add a new template to boot, so how about 'featorfix`?
| "project_name": "crawlee-python-project", | ||
| "__package_name": "{{ cookiecutter.project_name|lower|replace('-', '_') }}", | ||
| "crawler_type": ["beautifulsoup", "parsel", "playwright"], | ||
| "crawler_type": ["beautifulsoup", "parsel", "playwright", "camoufox"], |
There was a problem hiding this comment.
I'd prefer to call this playwright-camoufox for example.
| # % endif | ||
| # % endblock | ||
| # % endfilter | ||
| {% if self.pre_main is defined %} |
There was a problem hiding this comment.
Interesting trick! Could you use line expressions (# % if ...) here like in the rest of the file?
| # % endblock | ||
|
|
||
| # % block pre_main | ||
| class ExampleCamoufoxPlugin(PlaywrightBrowserPlugin): |
There was a problem hiding this comment.
Let's leave out the "Example" prefix 🙂
| import asyncio | ||
|
|
||
| # This external package needs to be installed. It is not included in crawlee. | ||
| from camoufox import AsyncNewBrowser # type: ignore[import-not-found] |
There was a problem hiding this comment.
Could we ignore that check on the project level so that the example is cleaner?
There was a problem hiding this comment.
There is a lot of stuff going on that could distract the reader from the actual gist of the example - could we pare it down a bit?
There was a problem hiding this comment.
I reduced most of the example and kept only minimal example that still demonstrates the use of the crawler.
There was a problem hiding this comment.
Can you mention the new template here as well?

Description
Show how to integrate
CamoufoxintoPlaywrightCrawler.Added one docs page and one example code.
Added
playwright-camoufoxtemplate to cli callcrawlee create.Fixed wrong template indentation when
Apify integrationwas selected in cli.Issues