Skip to content Skip to sidebar Skip to footer

By Combining Base Url Getting Text Out Of Image In Python Using Scrapy?

i tried this code : src1 = 'https://hms.harvard.edu/'
src = response.css('div.person-line > div > img::attr('src')').extract_first()
src = sites/

Solution 1:

You should use io.BufferIO buffer, because you call function image_to_string with http path. You need write code like this:

def get_text(src):
    response = urlopen(src)
    buffer = io.BytesIO(response.read())
    return pytesseract.image_to_string(Image.open(buffer))

Post a Comment for "By Combining Base Url Getting Text Out Of Image In Python Using Scrapy?"