tasos-py / Search-Engines-Scraper

Search google, bing, yahoo, and other search engines with python
MIT License
513 stars 137 forks source link

Unsupported or invalid CSS selector #50

Closed pegaggio closed 2 years ago

pegaggio commented 2 years ago

When searching with google I get this error. ` Searching Google

page: 1 links: 9Traceback (most recent call last): File "C:/Users/pegag/AppData/Local/Programs/Python/Python38/scrapesearch.py", line 4, in results = engine.search("my query") File "C:/Users/pegag/AppData/Local/Programs/Python/Python38\search_engines\engine.py", line 171, in search request = self._next_page(tags) File "C:/Users/pegag/AppData/Local/Programs/Python/Python38\search_engines\engines\google.py", line 36, in _next_page next_page = self._get_tag_item(tags.select_one(selector), 'href') File "C:\Users\pegag\AppData\Local\Programs\Python\Python38\lib\site-packages\bs4\element.py", line 1340, in select_one value = self.select(selector, limit=1) File "C:\Users\pegag\AppData\Local\Programs\Python\Python38\lib\site-packages\bs4\element.py", line 1476, in select raise ValueError( ValueError: Unsupported or invalid CSS selector: "a[href][aria-label=Page 2]" `

tasos-py commented 2 years ago

This is probably because of your bs4 version, I don't get this error on my pc. I updated /requirements.txt with my bs4 version, could you give it try?

pegaggio commented 2 years ago

That worked! thank you so much. <3