mirror of
https://github.com/benbusby/whoogle-search.git
synced 2026-04-25 04:05:57 +03:00
[GH-ISSUE #183] [BUG] Using Whoogle to scrape Google search results is very difficult due to strange class names #128
Labels
No labels
Fixed (Pending PR Merge)
Stale
bug
enhancement
enhancement
good first issue
help wanted
keep-open
needs more info
pull-request
question
theme
unfortunate
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/whoogle-search#128
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @mendel5 on GitHub (Jan 24, 2021).
Original GitHub issue: https://github.com/benbusby/whoogle-search/issues/183
Describe the bug
I am using Whoogle to scrape Google search results. The reason I am using Whoogle and not Google directly is because Google regularly asks my scraper to solve a Recaptcha.
My technical setup is Python with
SeleniumandFirefoxas webdriver. The rendered HTML gets parsed withbeautiful soup.The naming scheme of the HTML classes on Whoogle's search result page makes it very difficult to scrape and parse what I am actually looking for. I would like to scrape the website's title, the description and the URL.
For example the URLs on the search results page are contained in
<div class="kCrYT">. However there are other elements of the same class that don't contain a link. It would be very helpful for the<a href=""tag to have it's own class.The website description is contained in
<div class="BNeawe s3v9rd AP7Wnd">. The links to the previous page and next page are contained in the sameclass="nBDE1b G5eFlf". It would be helpful for both page links to have different classes or specific ids.To Reproduce
Steps to reproduce the behavior:
Deployment Method
Download git repo and use
runexecutableVersion of Whoogle Search
Whoogle Search v0.3.0@mendel5 commented on GitHub (Jan 25, 2021):
As far as I can see the strange HTML class names are originating from Google and Whoogle just inherits them?
@benbusby commented on GitHub (Jan 25, 2021):
Yes, all classes are inherited from Google directly. They also change fairly frequently, as I've discovered in the past. It'd probably be better to use BeautifulSoup to look for patterns in the HTML rather than classes (i.e. extract all
atags with ah3child, since that's how the results are formatted), but off the top of my head I'm not sure of an exact solution.@mendel5 commented on GitHub (Jan 25, 2021):
That seems to be quite evil by Google...
Thanks for the suggestion. I'll see what I can do.