Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Headless mode not loading profile #67

Open
ap0l0 opened this issue May 4, 2023 · 2 comments
Open

[BUG] Headless mode not loading profile #67

ap0l0 opened this issue May 4, 2023 · 2 comments

Comments

@ap0l0
Copy link

ap0l0 commented May 4, 2023

Seems like headless mode is not loading profile. It does the entire sequence in every run:

=> Script started
[*] => Downloading webdriver for your version of Chrome
[*] => Loading Instagram
[*] => Running in headless mode
[*] => Delay: 2-15 secs
[*] => Max. comments to like: 2
[*] => Using profile: /Users/xx/Library/Application Support/Google/Chrome/Default
[*] => Launching Instagram
[*] => [launch_insta]: Attempt - 1
[*] => Checking if user is already logged in
[*] => [Attempt# 1] Validating login

[*] => Failed to validate login
[*] => [Attempt# 2] Validating login
[*] => Failed to validate login
[*] => [Attempt# 3] Validating login
[*] => Failed to validate login
[*] => User not logged in. Attempting to login
[*] => Could not locate 2 factor authentication screen
[*] => Could not locate 2 factor authentication screen
[*] => Validating login
[*] => [Attempt# 1] Validating login
[*] => Logged in successfully

@shine-jayakumar
Copy link
Owner

shine-jayakumar commented May 5, 2023

The first time you run it with a profile, you're required to enter your 2-factor auth code, even if the profile you're using has the credentials already saved.
Once you enter your code, script will save the login for the next time (click on 'Save Login info').
The next time you run the script with profile, script can land directly on the user's page, skipping login and 2-factor auth screen.

It's working for me.

[*] => Script started
[*] => Downloading webdriver for your version of Chrome
[*] => Loading Instagram
[*] => Running in headless mode
[*] => Delay: 1-10 secs
[*] => Using profile: /home/user/.config/google-chrome/Profile 1
[*] => Launching Instagram
[*] => [launch_insta]: Attempt - 1
[*] => Checking if user is already logged in
[*] => [Attempt# 1] Validating login
[*] => Setting target to: ed_garlands
[*] => Opening target ed_garlands
[*] => [open_target]: Attempt - 1
[*] => Finding followers of ed_garlands
[*] => Restricting followers search to: 2
[*] => Opening followers list
[*] => Getting updated list of username divs
[*] => StaleElementReferenceException exception occured while capturing username links
[*] => Capturing div containing followers' list
[*] => Processing userdiv range: 0 - 22
[*] => Total username count: 2

@ap0l0
Copy link
Author

ap0l0 commented May 5, 2023

I think it happens when a new profile file is created, even if the Chrome profile is the same. It's a minor issue anyway, maybe is something local

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants