alirezamika / autoscraper

A Smart, Automatic, Fast and Lightweight Web Scraper for Python
MIT License
6.24k stars 654 forks source link

build method with wanted_dict does not work. #30

Closed romain-utelly closed 4 years ago

romain-utelly commented 4 years ago

Tested with autoscraper-1.1.6

When calling the build method with wanted_dict, the method behaves badly as it treats the searched string as an array of individual letters. The culprit is around l.204 of auto_scraper.py as the data structure does not behave the same as when you use the wanted_list option.

Besides this, I find the work done so far super interesting and promising. Keep up the good work.

R.

alirezamika commented 4 years ago

The values of the provided wanted_dict should be list of strings (they are treated as iterables), not a single string. like:

{'titles': ['title1', 'title2', 'title3']}

Thanks.

romain-utelly commented 4 years ago

I see, thanks for clarifying, my misunderstanding. Keep you the good work!

ws1088 commented 3 years ago

i guess another user hitting similar issues. an exception would be very nice to tell users what the API is expecting...