3 ms·
It looks like even with all the more recent nonsense Google inserts into the results it is still easy to just extract the result URLs and leave behind the rest
by 1vuio0pswjnm7 6y ago
It looks like even with all the more recent nonsense Google inserts into the results it is still easy to just extract the result URLs and leave behind the rest of the crud. If you want to retain the description text it is a little more work.
Interestingly, the /aclk? Ad URLs do not use HTTPS.
Seeing that these Ad URLs are still unobtrusive, I am wondering why anyone would want to remove them from the search results page. For cosmetic reasons?
I prefer searching from the command line. To remove the /aclk? Ad URL's I used sed and tr.
#!/bin/sh
# usage: $0 query > 1.htm
#
x=$(echo y|tr y '\004');
z=$(echo https://www.google.com/search?q=$@\&num=100|sed 's/ /%20/g');
curl --resolve www.google.com:443:172.217.17.100 -Huser-agent: "$z"|sed "s/<a href=\"\/url?q=/"$x"&/g"|tr '\004' '\012'|sed -n '/url?q=/{s/.url?q=//;s/&sa=.*\"><h3/\"><h3/;s/&sa=.*\"><span/\"><span/;s/$/<br>/;/aclk?/d;p;}'