Using a very basic profile with headless browser enabled.
session = InstaPy(username=insta_username, password=insta_password, headless_browser=True, bypass_suspicious_attempt=True)
It sends the email but when I enter the code I get:
Cookie file not found, creating cookie...
Instagram detected an unusual login attempt
A security code was sent to your Email:
Type the security code here:
INFO [2019-06-30 16:35:17] [] Sessional Live Report:
|> No any statistics to show
[Session lasted 10.96 minutes]
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
INFO [2019-06-30 16:35:17] [] Session ended!
ooooooooooooooooooooooooooooooooooooooooooooooooooooooo
Traceback (most recent call last):
File "quickstart.py", line 18, in
with smart_run(session):
File "/usr/lib/python3.5/contextlib.py", line 59, in __enter__
return next(self.gen)
File "/root/InstaPy/20190628/InstaPy/instapy/util.py", line 1679, in smart_run
session.login()
File "/root/InstaPy/20190628/InstaPy/instapy/instapy.py", line 407, in login
self.bypass_with_mobile):
File "/root/InstaPy/20190628/InstaPy/instapy/login_util.py", line 271, in login_user
bypass_suspicious_login(browser, bypass_with_mobile)
File "/root/InstaPy/20190628/InstaPy/instapy/login_util.py", line 137, in bypass_suspicious_login
read_xpath(bypass_suspicious_login.__name__,"wrong_login")))
File "/root/environments/my_env/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 394, in find_element_by_xpath
return self.find_element(by=By.XPATH, value=xpath)
File "/root/environments/my_env/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 978, in find_element
'value': value})['value']
File "/root/environments/my_env/lib/python3.5/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/root/environments/my_env/lib/python3.5/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.InvalidArgumentException: Message: invalid argument: 'value' must be a string
(Session info: headless chrome=75.0.3770.100)
(Driver info: chromedriver=2.46.628388 (4a34a70827ac54148e092aafb70504c4ea7ae926),platform=Linux 4.4.0-112-generic x86_64)
I also had the same error except for:
selenium.common.exceptions._WebDriverException_: Message: invalid argument: 'value' must be a string
I tried it a few times with instapy ajnd entered the codes an also manually logged in on instagram with the browser. I got a few Mails where I had to confirm that was me. And now it works. Perhaps this works for you too.
Greetings Simon
Same issue.
Fixed it by modifying:
https://github.com/timgrossmann/InstaPy/blob/44482c77524f295d5bd0b0220a6239705066ca6d/instapy/login_util.py#L136-L137
Like this :
wrong_login = browser.find_element_by_xpath(str(read_xpath(bypass_suspicious_login.__name__,"wrong_login")))
Reference :
https://github.com/timgrossmann/InstaPy/pull/4569
Worked
Worked perfectly! Thanks!
Worked!
This should be merged to the next version asap!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
If this problem still occurs, please open a new issue
@sydney-d do you have discord? I NEED YOUR HELP SO MUCH
Most helpful comment
Same issue.
Fixed it by modifying:
https://github.com/timgrossmann/InstaPy/blob/44482c77524f295d5bd0b0220a6239705066ca6d/instapy/login_util.py#L136-L137
Like this :
Reference :
https://github.com/timgrossmann/InstaPy/pull/4569