我的目标是要拥有24/7全天候运行的instagram僵尸程序,因此我在树莓派4上运行InstaPy + Scheduler脚本,经过一些活动后,我收到一个错误,我真的不知道如何解决,有什么建议吗?
from instapy import InstaPy
import schedule
import random
from numpy.random import random as rdm
import time
insta_username = '******'
insta_password = '******'
def work():
hashtags = ['****']
random.shuffle(hashtags)
my_hashtags = hashtags[:10]
session = InstaPy(username=insta_username, password=insta_password, disable_image_load=True)
session.login()
# some settings
session.like_by_tags(my_hashtags[0:2], amount=20)
session.end()
schedule.every().day.at("05:55").do(work)
while True:
schedule.run_pending()
time.sleep(1)
我希望能正常工作,但是我得到了:
INFO [2019-10-17 05:19:19] [daprostitnasbog] Like# [11/24]
INFO [2019-10-17 05:19:19] [daprostitnasbog] https://www.instagram.com/p/B3s7-dEjFdM/
Traceback (most recent call last):
File "Desktop/Sakura/Bot/daprostitnasbog2.py", line 94, in <module>
schedule.run_pending()
File "/home/pi/.local/lib/python3.7/site-packages/schedule/__init__.py", line 563, in run_pending
default_scheduler.run_pending()
File "/home/pi/.local/lib/python3.7/site-packages/schedule/__init__.py", line 94, in run_pending
self._run_job(job)
File "/home/pi/.local/lib/python3.7/site-packages/schedule/__init__.py", line 147, in _run_job
ret = job.run()
File "/home/pi/.local/lib/python3.7/site-packages/schedule/__init__.py", line 466, in run
ret = self.job_func()
File "Desktop/Sakura/Bot/daprostitnasbog2.py", line 71, in work
session.like_by_tags(my_hashtags[0:2], amount=20)
File "/home/pi/.local/lib/python3.7/site-packages/instapy /instapy.py", line 1925, in like_by_tags
self.logger,
File "/home/pi/.local/lib/python3.7/site-packages/instapy /like_util.py", line 613, in check_link
user_name,
File "/home/pi/.local/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 636, in execute_script
'args': converted_args})['value']
File "/home/pi/.local/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/home/pi/.local/lib/python3.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.JavascriptException: Message: TypeError: window.insta_data is undefined