crawl4ai version
0.7.4
Expected Behavior
When using the Undetected Browser Mode and enable_stealth mode, there will be no problem with incorrect selection of elements.
Current Behavior
browser_config = BrowserConfig(
headless=False,
verbose=False,
enable_stealth=True,
)
# adapter = UndetectedAdapter()
# strategy = AsyncPlaywrightCrawlerStrategy(
# browser_config=browser_config, browser_adapter=adapter
# )
crawler = AsyncWebCrawler(
# crawler_strategy=strategy,
config=browser_config
)
After using the Undetected Browser Mode, there is a problem with the selection of the page element in the callback function. The selected element, element.inner_html(), is the entire content of the page. If I uncomment it, using the combination mode of Undetected Browser Mode and enable_stealth, it appears in the callback function, for example:
on_execution_started,Obtain the page object and then through
rows = await page.query_selector_all(".list .table tbody tr.cur")
if rows:
first_row = rows[0]
print(await first_row.inner_html())
print(await first_row.inner_text())
The printed results are not the content of that element.
However, if I only use "enable_stealth", there won't be any problem.
Is this reproducible?
Yes
Inputs Causing the Bug
Steps to Reproduce
Code snippets
OS
Windows
Python version
3.12
Browser
chrome
Browser version
No response
Error logs & Screenshots (if applicable)
No response