简体   繁体   English

无法修复此回溯(python webdriver)

[英]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.我想为我的交易创建自动刷新器,但我不使用 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.我想为我的交易创建自动刷新器,但我不使用 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但首先他应该登录网站

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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