我正在玩 instapy,我从快速入门中收到以下错误。这是我的错误我认为 selenium.common.exceptions.WebDriverException: Message: TypeError: browseContextFn().currentWindowGlobal is null
""" Quickstart script for InstaPy usage """
# imports
from instapy import InstaPy
from instapy import smart_run
# login credentials
insta_username = '' # <- enter username here
insta_password = '' # <- enter password here
# get an InstaPy session!
# set headless_browser=True to run InstaPy in the background
session = InstaPy(username=insta_username,
password=insta_password,
headless_browser=False)
with smart_run(session):
""" Activity flow """
# general settings
session.set_relationship_bounds(enabled=True,
delimit_by_numbers=True,
max_followers=4590,
min_followers=45,
min_following=77)
session.set_dont_include(["friend1", "friend2", "friend3"])
session.set_dont_like(["pizza", "#store"])
# activity
session.like_by_tags(["natgeo"], amount=10)
谁能指出我正确的方向,我是 python 新手。这是错误摘要。
Traceback (most recent call last):
File "/Users/computer/Instagrow/urbley.py", line 16, in <module>
with smart_run(session):
File "/usr/local/Cellar/python@3.9/3.9.1_4/Frameworks/Python.framework/Versions/3.9/lib/python3.9/contextlib.py", line 117, in __enter__
return next(self.gen)
File "/usr/local/lib/python3.9/site-packages/instapy/util.py", line 1920, in smart_run
session.login()
File "/usr/local/lib/python3.9/site-packages/instapy/instapy.py", line 425, in login
if not login_user(
File "/usr/local/lib/python3.9/site-packages/instapy/login_util.py", line 362, in login_user
dismiss_get_app_offer(browser, logger)
File "/usr/local/lib/python3.9/site-packages/instapy/login_util.py", line 466, in dismiss_get_app_offer
offer_loaded = explicit_wait(
File "/usr/local/lib/python3.9/site-packages/instapy/util.py", line 1784, in explicit_wait
result = wait.until(condition)
File "/usr/local/lib/python3.9/site-packages/selenium/webdriver/support/wait.py", line 71, in until
value = method(self._driver)
File "/usr/local/lib/python3.9/site-packages/selenium/webdriver/support/expected_conditions.py", line 128, in __call__
return _element_if_visible(_find_element(driver, self.locator))
File "/usr/local/lib/python3.9/site-packages/selenium/webdriver/support/expected_conditions.py", line 415, in _find_element
raise e
File "/usr/local/lib/python3.9/site-packages/selenium/webdriver/support/expected_conditions.py", line 411, in _find_element
return driver.find_element(*by)
File "/usr/local/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 976, in find_element
return self.execute(Command.FIND_ELEMENT, {
File "/usr/local/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python3.9/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: TypeError: browsingContextFn().currentWindowGlobal is null