Closed TPGamesNL closed 3 months ago
two main ways:
cookieConsent=true
we can easily add it to our requests to Google ourselvesthis, of course, isn't great, and not very stable. we should highly consider alternatives for these searches, such as a proper API
For normal (text) search, the issue was simply that Google renewed their interface, and thus changed names of CSS classes (which are obfuscated, so anytime they update it probably changes). These class names are used to identify the relevant links. While there is a cookie popup on the page as well, it is overlaid on top of the regular search page, so the HTML from the search results is still visible. This can easily be fixed by updating the CSS classes used in the code. Of course this is a short term solution, as the interface can change at any time and break this software.
For reverse image search, the issue is two-fold.
Progress tracked in branch fix-google-search
, and in PR #9
To get Google Lens to give good results again, try scaling the image and check performance per image size
finally fixed this. now sends a cookie requests via requests
, then uses those cookies for the reverse image search. however, can't call html render because for some reason that still opens the cookie popup
by code
self.main_logger.info(f"Res body: {r.html}")