-
-
Notifications
You must be signed in to change notification settings - Fork 124
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
NameError: name 'AntiDetectDriver' is not defined #155
Comments
Please post your code |
from botasaurus.browser import browser, Driver @browser()
|
I am having the same error, the code is as below:
The error is as below:
|
Which version of botasaurus you use? |
I've got the same issue. Here's the output of pip freeze anyio==4.4.0 |
you have the latest version of Botasaurus, where the name was changed from AntiDetectDriver to Driver, etc |
That explains a lot, thanks! |
@Halone228 > you have the latest version of Botasaurus, where the name was changed from AntiDetectDriver to Driver, etc Thanks for the reply, that explains it. Does this mean the Driver and AntiDetectDriver are the same now, that is, every Driver is AntiDetectDriver? From what I saw earlier was that Driver did not have some properties that AntiDetectDriver had, for instance, getting element_or_none, etc. Is there a list of changes made in this version available? Thanks :) |
Actually it still doesn't work: my code:
the error:
response of pip freeze:
|
from README.md from botasaurus.browser import browser, Driver
@browser
def scrape_heading_task(driver: Driver, data):
# Visit the Omkar Cloud website
driver.get("https://www.omkar.cloud/")
# Retrieve the heading element's text
heading = driver.get_text("h1")
# Save the data as a JSON file in output/scrape_heading_task.json
return {
"heading": heading
}
# Initiate the web scraping task
scrape_heading_task() you need import |
botasaurus.browser.Driver is not the same as AntiDetectDriver as per my understanding of the following code ([https://github.com/omkarcloud/botasaurus/blob/master/docs/docs/google-maps-scraping-tutorial.md]):
AntiDetectDriver has the property driver.get_element_or_none(XPath), while Driver does not. |
NameError Traceback (most recent call last) in <cell line: 3>() 2 3 @browser(cache=True) ----> 4 def scrape_heading_task(driver: AntiDetectDriver, link): 5 driver.get(link) 6 heading = driver.get_text("h1") NameError: name 'AntiDetectDriver' is not defined
The text was updated successfully, but these errors were encountered: