0

I am using selenium-wire to click a button using Chrome browser. Up until today, my code worked fine. However, now I get the following error and I am not sure why:

Traceback (most recent call last):
File "Scraping_fx.py", line 1, in <module>
from seleniumwire import webdriver
File "C:\Users\me\Anaconda3\envs\project\lib\site- 
packages\seleniumwire\webdriver\__init__.py", line 3, in <module>
from .browser import Chrome, Edge, Firefox, Safari  # noqa
File "C:\Users\me\Anaconda3\envs\project\lib\site- 
packages\seleniumwire\webdriver\browser.py", line 14
def __init__(self, *args, seleniumwire_options=None, **kwargs):
                                             ^
SyntaxError: invalid syntax

I am using python 2.7.16; selenium-wire 1.0.4.

from seleniumwire import webdriver
from selenium.common.exceptions import ElementClickInterceptedException,NoSuchElementException
import logging

def scrape_website(url):

    # Configure browser driver
    options = webdriver.ChromeOptions()
    options.add_argument('--no-sandbox')
    options.add_argument('--disable-gpu')
    options.add_argument('--headless')

    #Instantiate driver and navigate to URL
    driver = webdriver.Chrome(chrome_options=options)
    driver.implicitly_wait(30)
    driver.get(url)

Am I missing something here?

AntsaR
  • 370
  • 1
  • 7
  • 23

1 Answers1

0

Can't see anything wrong with your code :) But selenium-wire 1.0.4 requires Python 3.4+.

You can find all the info on pypi.org - here