zaidabouhal / AsianOdds.com-Scrapper

This is python scrapper i build that scrappes data from asianodds.com past games
0 stars 0 forks source link

Don't work #1

Open obtim opened 3 years ago

obtim commented 3 years ago

Don't work in powershell

DevTools listening on ws://127.0.0.1:27741/devtools/browser/9c620152-351d-4379-a6ea-fc8226287199 Traceback (most recent call last): File "C:\Users\obtim\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\common\service.py" , line 72, in start self.process = subprocess.Popen(cmd, env=self.env, File "C:\Users\obtim\AppData\Local\Programs\Python\Python38-32\lib\subprocess.py", line 854, in init self._execute_child(args, executable, preexec_fn, close_fds, File "C:\Users\obtim\AppData\Local\Programs\Python\Python38-32\lib\subprocess.py", line 1307, in _execute_child hp, ht, pid, tid = _winapi.CreateProcess(executable, args, FileNotFoundError: [WinError 2] Не удается найти указанный файл

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "main.py", line 36, in driver = webdriver.Chrome(executable_path="/seleniumDrivers/") File "C:\Users\obtim\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\chrome\webdriver.p y", line 73, in init self.service.start() File "C:\Users\obtim\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\common\service.py" , line 81, in start raise WebDriverException( selenium.common.exceptions.WebDriverException: Message: '' executable needs to be in PATH. Please see https://sites.goog le.com/a/chromium.org/chromedriver/home

PS C:\AsianOdds.com-Scrapper-main> [16152:14028:0602/101555.493:ERROR:device_event_log_impl.cc(214)] [10:15:55.494] FIDO : webauthn_api.cc:54 Windows WebAuthn API failed to load

and don't work in CygWin Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/common/service.py", line 72, in start self.process = subprocess.Popen(cmd, env=self.env, File "/usr/lib/python3.8/subprocess.py", line 854, in init self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/lib/python3.8/subprocess.py", line 1702, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) PermissionError: [Errno 13] Permission denied: 'chromedriver'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "main.py", line 35, in driver = webdriver.Chrome() File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/chrome/webdriver.py", line 73, in init self.service.start() File "/usr/local/lib/python3.8/site-packages/selenium/webdriver/common/service.py", line 86, in start raise WebDriverException( selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable may have wrong permissions. Please see https://sites.google.com/a/chromium.org/chromedriver/home

zaidabouhal commented 2 years ago

Are you sure you have updated the driver path in main.py ? Or either test it with cmd and executing it with admin permission instead ?

obtim commented 2 years ago
  1. I User Anaconda enviroment on Win7 x64(with Admin priv)
  2. Python version is 3.8.8.
  3. Chrome Driver version is 103.0.5060.53(Stable)
  4. The "pip install xlwrt" package is not installed. Decided that there is a pisspot here. Installed "pip install xlwt" xlwt is 1.3.0 version xlsxwriter is 1.3.8 version argparse is 1.4.0 version selenium is 3.141.0 version requests is 2.25.1
  5. I corrected the path in page 36 of the main.py file to the correct "driver = webdriver.Chrome(executable_path=r'C:/chromedriver_win32/chromedriver.exe')" The error is different now: (base) c:\AsianOdds.com-Scrapper-main>python main.py -f outputfile.xlsx --userna me xxx@mail.ru --password xxx DevTools listening on ws://127.0.0.1:17303/devtools/browser/d8f66225-06a0-4800-9 e4b-3db074410c6e

DevTools listening on ws://127.0.0.1:17317/devtools/browser/61370dae-fe22-4dc2-9 955-3a4c980c1957 [] Traceback (most recent call last): File "main.py", line 45, in email = driver.find_element_by_xpath("/html/body/div[6]/div/div/div[1]/div/d iv/div[1]/div/div[2]/form/div[2]/input") File "C:\Users\xxx\anaconda3\lib\site-packages\selenium\webdriver\remote\web driver.py", line 394, in find_element_by_xpath return self.find_element(by=By.XPATH, value=xpath) File "C:\Users\xxx\anaconda3\lib\site-packages\selenium\webdriver\remote\web driver.py", line 976, in find_element return self.execute(Command.FIND_ELEMENT, { File "C:\Users\xxx\anaconda3\lib\site-packages\selenium\webdriver\remote\web driver.py", line 321, in execute self.error_handler.check_response(response) File "C:\Users\xxx\anaconda3\lib\site-packages\selenium\webdriver\remote\err orhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.NoSuchElementException: Message: no such element: Una ble to locate element: {"method":"xpath","selector":"/html/body/div[6]/div/div/d iv[1]/div/div/div[1]/div/div[2]/form/div[2]/input"} (Session info: chrome=103.0.5060.114)

  1. The chrome browser window opens on the credentials page. The login and password sent on the command line are not entered. A window prompting to accept cookies hangs at the bottom.