简体   繁体   中英

Can't fix this traceback(python webdriver)

from bs4 import BeautifulSoup
from selenium.webdriver.chrome.options import Options
import requests


chrome_options = Options()  
chrome_options.add_argument("--headless")  
driver = webdriver.Chrome(options=chrome_options, executable_path=r'C:\bin\chromedriver.exe')  
options = webdriver.ChromeOptions()

driver.get('https://rocket-league.com/trade/edit?trade=*********')

url = 'https://rocket-league.com/trade/edit?trade=*********'
login = 'email'
password = 'password'
s = requests.Session()
r = s.get(url, auth=(login, password))

edit = driver.find_element_by_css_selector('.rlg-btn-primary')
edit.click()

DevTools listening on ws://127.0.0.1:61790/devtools/browser/2a14f9a0-c219-4f80-b3a9-cb7faecb1805
[0722/013746.738:INFO:CONSOLE(1)] "The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://developers.google.com/web/updates/2017/09/autoplay-policy-changes#webaudio", source: https://rocket-league.com/scripts/ffp-aws.js (1)
Traceback (most recent call last):
  File "c:/Users/OdMensss/Desktop/parse.py", line 21, in <module>
    edit.click()
  File "C:\Users\OdMensss\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\webelement.py", line 80, in click
    self._execute(Command.CLICK_ELEMENT)
  File "C:\Users\OdMensss\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\webelement.py", line 633, in _execute
    return self._parent.execute(command, params)
  File "C:\Users\OdMensss\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "C:\Users\OdMensss\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element is not clickable at point (1077, 17)
  (Session info: headless chrome=84.0.4147.89)

PS C:\Users\OdMensss> [0722/013750.291:INFO:CONSOLE(0)] "Access to fetch at 'https://tracker.databrain.com/fp/rc.ashx?d=22093287&z=3&s=800600&b=33&v=622178458&e=0&i=0&p=0&h=4&pt=Win32&is=0&as=48002&jsf=0' from origin 'https://rocket-league.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.", source: https://rocket-league.com/login (0)
[0722/013750.292:INFO:CONSOLE(0)] "Uncaught (in promise) TypeError: Failed to fetch", source: https://rocket-league.com/login (0)

I want to create autorefresher for my trades and i don't working with Python. Help me pls. Script just should click on the "Edit trade" button and that's it. But first he should login on the site

from bs4 import BeautifulSoup
from selenium.webdriver.chrome.options import Options
import requests


chrome_options = Options()  
chrome_options.add_argument("--headless")  
driver = webdriver.Chrome(options=chrome_options, executable_path=r'C:\bin\chromedriver.exe')  
options = webdriver.ChromeOptions()

driver.get('https://rocket-league.com/trade/edit?trade=*********')

url = 'https://rocket-league.com/trade/edit?trade=*********'
login = 'email'
password = 'password'
s = requests.Session()
r = s.get(url, auth=(login, password))

edit = driver.find_element_by_css_selector('.rlg-btn-primary')
edit.click()

DevTools listening on ws://127.0.0.1:61790/devtools/browser/2a14f9a0-c219-4f80-b3a9-cb7faecb1805
[0722/013746.738:INFO:CONSOLE(1)] "The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://developers.google.com/web/updates/2017/09/autoplay-policy-changes#webaudio", source: https://rocket-league.com/scripts/ffp-aws.js (1)
Traceback (most recent call last):
  File "c:/Users/OdMensss/Desktop/parse.py", line 21, in <module>
    edit.click()
  File "C:\Users\OdMensss\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\webelement.py", line 80, in click
    self._execute(Command.CLICK_ELEMENT)
  File "C:\Users\OdMensss\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\webelement.py", line 633, in _execute
    return self._parent.execute(command, params)
  File "C:\Users\OdMensss\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "C:\Users\OdMensss\AppData\Local\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element is not clickable at point (1077, 17)
  (Session info: headless chrome=84.0.4147.89)

PS C:\Users\OdMensss> [0722/013750.291:INFO:CONSOLE(0)] "Access to fetch at 'https://tracker.databrain.com/fp/rc.ashx?d=22093287&z=3&s=800600&b=33&v=622178458&e=0&i=0&p=0&h=4&pt=Win32&is=0&as=48002&jsf=0' from origin 'https://rocket-league.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.", source: https://rocket-league.com/login (0)
[0722/013750.292:INFO:CONSOLE(0)] "Uncaught (in promise) TypeError: Failed to fetch", source: https://rocket-league.com/login (0)

I want to create autorefresher for my trades and i don't working with Python. Help me pls. Script just should click on the "Edit trade" button and that's it. But first he should login on the site

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM