question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Constantly receiving `Not solved` while using `fromdriver`

See original GitHub issue

The following keeps returning Not solved for me. I have never got any other return.

import selenium
from amazoncaptcha import AmazonCaptcha
from selenium import webdriver as webdriver

d = webdriver.Chrome(ChromeDriverManager().install())
captcha = AmazonCaptcha.fromdriver(d)
print(captcha.solve(keep_logs=True))

not-solved-captcha.log: https://images-na.ssl-images-amazon.com/captcha/bfhuzdtn/Captcha_cebmxydbrt.jpg https://images-na.ssl-images-amazon.com/captcha/perumqgc/Captcha_gaommpndkq.jpg https://images-na.ssl-images-amazon.com/captcha/rhnrlggh/Captcha_tijaodpupx.jpg https://images-na.ssl-images-amazon.com/captcha/bysppkyq/Captcha_xroxbnvmrg.jpg

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
a-maliarovcommented, Oct 25, 2020

So, in your code, when you are on the page with captcha, instead of using fromdriver, firstly extract the captcha image link and then use fromlink. Since it is the first img at the page, it is not obligatory to use BautifulSoup, but you can do the extraction your way. The main point is to just get the captcha link.

Here is the example of what I mean:

from webdriver_manager.chrome import ChromeDriverManager
from amazoncaptcha import AmazonCaptcha
from selenium import webdriver

driver = webdriver.Chrome(ChromeDriverManager().install())
driver.get('https://www.amazon.com/errors/validateCaptcha')

captcha_link = driver.page_source.split('<img src="')[1].split('">')[0]   # extract captcha link
captcha = AmazonCaptcha.fromlink(captcha_link)                            # pass it to `fromlink` class method
print(captcha.solve())
2reactions
a-maliarovcommented, Oct 25, 2020

These four links are working fine for me, I assume that the problem is connected to how captcha image is displayed in your browser (because fromdriver class method takes a screenshot and then crops the captcha image).

Try another class method - fromlink. This will use the captcha image link, therefore it will be not relevant how the image is displayed in the browser.

Here is the example with those four links:

from amazoncaptcha import AmazonCaptcha

links = [
    'https://images-na.ssl-images-amazon.com/captcha/bfhuzdtn/Captcha_cebmxydbrt.jpg',
    'https://images-na.ssl-images-amazon.com/captcha/perumqgc/Captcha_gaommpndkq.jpg',
    'https://images-na.ssl-images-amazon.com/captcha/rhnrlggh/Captcha_tijaodpupx.jpg',
    'https://images-na.ssl-images-amazon.com/captcha/bysppkyq/Captcha_xroxbnvmrg.jpg'
]

for link in links:    
    captcha = AmazonCaptcha.fromlink(link)
    print(captcha.solve())
Read more comments on GitHub >

github_iconTop Results From Across the Web

I am getting the following error for almost every operation of ...
I am getting the following error for almost every operation of the software: "An error occured and was automatically reported SCRIPT ERROR".
Read more >
TPS929120EVM: Fault response from Driver TPS929120 - Power ...
I have been testing and building a solution for automotive applications. ... when I read from the same register, I receive incorrect data...
Read more >
Selenium Timed out receiving message from renderer
Solution : When Page Loading takes too much time for wait so we will wait for the DOMContentLoaded event with page load strategy....
Read more >
Solved: Failed to get DSM and MPIO properties from driver
I do, I have the Data ONTAP DSM. Looking under the Server Storage where I would expect to see the Active\Passive paths for...
Read more >
"Display driver stopped responding and has recovered" error ...
To resolve this issue, follow the steps in the methods starting with method 1 and then proceeding with method 2 and method 3...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found