【发布时间】:2023-02-10 07:23:50
【问题描述】:
我开始使用 InstaPy 库。为此,我启动了quickstart.py 文件来测试机器人。我输入了有效 instagram 帐户的用户名和密码,但我的机器人仍然停留在 cookies 页面上。
在执行期间(在 headless_browser=False 中),浏览器加载了 instagram 页面但仍然被阻止。这是我收到的错误消息:
No any custom workspace provided. ~using existing..
InstaPy Version: 0.6.16
._. ._. ._. ._. ._. ._. ._. ._. ._. ._. ._.
Workspace in use: "/home/clement-gaudiniere/InstaPy"
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
INFO [2022-10-26 15:12:06] [potat_oloh] Session started!
oooooooooooooooooooooooooooooooooooooooooooooooooooooo
INFO [2022-10-26 15:12:11] [potat_oloh] - Cookie file not found, creating cookie...
WARNING [2022-10-26 15:12:22] [potat_oloh] Login A/B test detected! Trying another string...
WARNING [2022-10-26 15:12:27] [potat_oloh] Could not pass the login A/B test.
Trying last string...
ERROR [2022-10-26 15:12:32] [potat_oloh] Login A/B test failed!
b"Message: Unable to locate element: //div[text()='Log In']\nStacktrace:\nRemoteError@chrome://remote/content/shared/RemoteError.jsm:12:1\nWebDriverError@chrome://remote/content/shared/webdriver/Errors.jsm:192:5\nNoSuchElementError@chrome://remote/content/shared/webdriver/Errors.jsm:404:5\nelement.find/</<@chrome://remote/content/marionette/element.js:291:16\n"
Traceback (most recent call last):
File "/home/clement-gaudiniere/InstaPy/instapy/login_util.py", line 337, in login_user
login_elem = browser.find_element(
File "/home/clement-gaudiniere/.local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 856, in find_element
return self.execute(Command.FIND_ELEMENT, {
File "/home/clement-gaudiniere/.local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 429, in execute
self.error_handler.check_response(response)
File "/home/clement-gaudiniere/.local/lib/python3.10/site-packages/selenium/webdriver/remote/errorhandler.py", line 243, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: //button[text()='Log In']
Stacktrace:
RemoteError@chrome://remote/content/shared/RemoteError.jsm:12:1
WebDriverError@chrome://remote/content/shared/webdriver/Errors.jsm:192:5
NoSuchElementError@chrome://remote/content/shared/webdriver/Errors.jsm:404:5
element.find/</<@chrome://remote/content/marionette/element.js:291:16
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/clement-gaudiniere/InstaPy/instapy/login_util.py", line 343, in login_user
login_elem = browser.find_element(
File "/home/clement-gaudiniere/.local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 856, in find_element
return self.execute(Command.FIND_ELEMENT, {
File "/home/clement-gaudiniere/.local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 429, in execute
self.error_handler.check_response(response)
File "/home/clement-gaudiniere/.local/lib/python3.10/site-packages/selenium/webdriver/remote/errorhandler.py", line 243, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: //a[text()='Log in']
6Stacktrace:
RemoteError@chrome://remote/content/shared/RemoteError.jsm:12:1
WebDriverError@chrome://remote/content/shared/webdriver/Errors.jsm:192:5
NoSuchElementError@chrome://remote/content/shared/webdriver/Errors.jsm:404:5
element.find/</<@chrome://remote/content/marionette/element.js:291:16
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/clement-gaudiniere/InstaPy/instapy/login_util.py", line 350, in login_user
login_elem = browser.find_element(
File "/home/clement-gaudiniere/.local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 856, in find_element
return self.execute(Command.FIND_ELEMENT, {
File "/home/clement-gaudiniere/.local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 429, in execute
self.error_handler.check_response(response)
File "/home/clement-gaudiniere/.local/lib/python3.10/site-packages/selenium/webdriver/remote/errorhandler.py", line 243, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: //div[text()='Log In']
Stacktrace:
RemoteError@chrome://remote/content/shared/RemoteError.jsm:12:1
WebDriverError@chrome://remote/content/shared/webdriver/Errors.jsm:192:5
NoSuchElementError@chrome://remote/content/shared/webdriver/Errors.jsm:404:5
element.find/</<@chrome://remote/content/marionette/element.js:291:16
........................................................................................................................
CRITICAL [2022-10-26 15:12:32] [potat_oloh] Unable to login to Instagram! You will find more information in the logs above.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
INFO [2022-10-26 15:12:32] [potat_oloh] Sessional Live Report:
|> No any statistics to show
[Session lasted 30.31 seconds]
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
INFO [2022-10-26 15:12:32] [potat_oloh] Session ended!
ooooooooooooooooooooooooooooooooooooooooooooooooooooooo
我尝试了几种建议的解决方案,但没有任何效果,我总是收到另一条错误消息,你有什么想法吗?
【问题讨论】:
标签: python python-3.x bots instagram instapy