我想为instgram运行自动登录并在python的任何地方运行它。它可以在我的计算机上完美运行,但不能在云中运行。
我正在尝试:
来自pyvirtualdisplay import显示导入时间display = Display(visible = 0,size =(800,600))display.start()
从硒导入网络驱动程序
从导入睡眠时间开始
重试范围(3):
try: browser = webdriver.Firefox() break except: time.sleep(3)
browser.implicitly_wait(5)
browser.get('https://www.instagram.com/accounts/login/?source=auth_switcher')
browser.maximize_window()
browser.implicitly_wait(5)
print('Title:“ {}”'。format(browser.title))
browser.find_element_by_name(“用户名”).send_keys(“ my_user”)
browser.find_element_by_name(“ password”)。send_keys(“ my_pass”)
browser.find_element_by_name(“ password”)。send_keys(u'\ ue007')
browser.implicitly_wait(5)
错误:
Traceback (most recent call last):
File "/home/tester32/gg/test.py", line 36, in <module>
browser.find_element_by_name("username").send_keys("xxxxxxxxx")
File "/home/tester32/.local/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 365,
in find_element_by_name
return self.find_element(by=By.NAME, value=name)
File "/home/xxxxxxx/.local/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 752,
in find_element
'value': value})['value']
Traceback (most recent call last):
File "/home/xxxxx/gg/test.py", line 36, in <module>
browser.find_element_by_name("username").send_keys("xxxxxxxxxx")
File "/home/tester32/.local/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 365,