SeleniumHQ / selenium

A browser automation framework and ecosystem.
https://selenium.dev
Apache License 2.0
30.19k stars 8.11k forks source link

[🐛 Bug]: NameError: name 'options' is not defined #14329

Closed KajuLar closed 1 month ago

KajuLar commented 1 month ago

What happened?

This is the project which I am trying to make https://github.com/michaelkitas/Google-Maps-Leads-Scraper-Selenium/blob/master/readme.md

How can we reproduce the issue?

from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options
from webdriver_manager.chrome import ChromeDriverManager
from seleniumwire import webdriver as seleniumwire_webdriver
import time
import json
import re/Users/macbook/Desktop/Selenium Google Scraper

chrome_options = webdriver.ChromeOptions()

service = Service(
  ChromeDriverManager().install()
)

driver = webdriver.Chrome(
  service=service, options=chrome_options, seleniumwire_options=options
)

driver = webdriver.Chrome()
keyword =   "dumbster"

driver.get(f'https://www.google.com/maps/search/$(keyword)/')

Relevant log output

macbook-MacBook-Pro:Selenium Google Scraper macbook$ /usr/local/bin/python3 "/Users/macbook/Desktop/Selenium Google Scraper/main.py"
Traceback (most recent call last):
  File "/Users/macbook/Desktop/Selenium Google Scraper/main.py", line 18, in <module>
    service=service, options=chrome_options, seleniumwire_options=options
                                                                  ^^^^^^^
NameError: name 'options' is not defined

Operating System

macOS 10.13.

Selenium version

Selenium

What are the browser(s) and version(s) where you see this issue?

Chrome

What are the browser driver(s) and version(s) where you see this issue?

Chrome Version 116.0.5845.187

Are you using Selenium Grid?

No

github-actions[bot] commented 1 month ago

@KajuLar, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

diemol commented 1 month ago

You don't have a variable named options, that is a compilation error. Not related to Selenium.

github-actions[bot] commented 1 month ago

💬 Please ask questions at:

github-actions[bot] commented 1 week ago

This issue has been automatically locked since there has not been any recent activity since it was closed. Please open a new issue for related bugs.