Can't work
ooxx5626 opened this issue · 14 comments
googler g 'Hello world' --json --debug
[DEBUG] googler version 3.7
[DEBUG] Python version 3.6.5
[DEBUG] Connecting to new host www.google.com
[DEBUG] Fetching URL /search?ie=UTF-8&oe=UTF-8&q=g+Hello+world
[DEBUG] Cookie: 1P_JAR=2018-10-09-02
[DEBUG] Response body written to '/tmp/googler-response-mtvebjol'.
[]
I'm use Ubuntu 18.04
Fetching URL is working
Ah yeah, something unexpected came up Friday night so I put that aside and later forgot to return to it.
I'll see if I can squeeze some time tonight.
Thanks a lot!
Not planning to work on the code until later, but I just took a cursory look at what changed. The critical part that toasted the parser:
<div class="r">
<a href="https://hello.com/" onmousedown="return rwt(this,'','','','21','AOvVaw0uz_Rl7wUIyc4UYfxyyaFH','','2ahUKEwipj6uLp_jdAhWhmeAKHaC2AH4QFjAUegQICxAB','','',event)">
<h3 class="LC20lb">hello network</h3><br>
<div style="display:inline-block" class="TbwUpd"><cite class="iUh30">https://hello.com/</cite></div>
</a>
<!-- other shit -->
</div>
Compare this to classical layout (--noua
):
<h3 class="r"><a href="/url?q=https://hello.com/&sa=U&ved=0ahUKEwiq262zqfjdAhWwg-AKHeXMCG0QFghsMAo&usg=AOvVaw3Mts57BoJM2EDR7KcNSz6e"><b>hello</b> network</a></h3>
<!-- other shit -->
This serious incompat will produce pretty confusing code.
Depending whether you want to go back to a real user agent, or just stick to the hot fix virtual user agent (more stable, but might be more sensitive to blocking):
- Use real user agent: will fix code, with (possibly very) confusing branching;
- Use virtual user agent: make
not ua
code the only branch, remove old default branch, since the virtual user agent isn't any different from no user agent from Google's POV; make--noua
a legacy no op option.
@jarun Your choice.
However, as long as the new UA is not blocked let's keep it.
That's totally fine.
I think --noua is more vulnerable to blocking than having a valid user agent.
I'm neutral on this point. "Might be more sensitive to blocking" was a comparison to a widely-adopted browser user agent.
In case I wasn't clear: when I said "make not ua
code the only branch, remove old default branch", I was pointing to the new custom user agent should follow the application logic of what used to be not ua
, since the server responses appear equivalent.
Ahh ok. My understanding was to discard googler's ua. I will run some tests this evening and get back.
The results with --noua
and googler's UA are different. More differences in the second page and so on... Let's keep both with googler's UA as default.
I will make a release shortly.
~/G/googler$ ./googler hello --noua
1 hello - YouTube [www.youtube.com]
22 Aug 2017 - 3 min - Uploaded by Lauv about making a big move, falling in love for the first time, and figuring out your own identity while ...
2 hello network [hello.com]
Connect with people who share your interests. Discover communities you love. Join fun conversations.
3 Hello (Adele song) - Wikipedia [en.wikipedia.org]
"Hello" is a song by English singer Adele, released on 23 October 2015 by XL Recordings as the lead single from her third studio album, 25 (2015). Adele ...
4 hello - Wiktionary [en.wiktionary.org]
The greeting hello is among the most generic and neutral in use. It may be heard in nearly all social situations and in nearly all walks of life, and is unlikely to ...
5 Hello Design [www.hellodesign.com]
Hello is a creative agency driven to craft worthy experiences. We believe everything will be digital—surrounding us like the air we breathe. Hello is ...
6 hello | Definition of hello in English by Oxford Dictionaries [en.oxforddictionaries.com]
Definition of hello - used as a greeting or to begin a telephone conversation.
7 Hello 4.0.0.0.0 for Android - Download [hello.en.uptodown.com]
Rating: 3.8 - 44 votes
Hello is an official app from Facebook that let's you see all of the information about the telephone numbers that call you. Also, you can block specific numbers or ...
8 hello Meaning in the Cambridge English Dictionary [dictionary.cambridge.org]
hello definition: 1. used when meeting or greeting someone: 2. something that is said at the beginning of a phone conversation: 3. something that is said to ...
9 Hello Games [www.hellogames.org]
We are Hello Games. We make games! Hello! Follow us on TWITTER, read our BLOG! Like us on FACEBOOK! Do you want to post YouTube videos of our ...
googler (? for help)
googler (? for help)
~/G/googler$ ./googler hello
1 hello network [hello.com]
Connect with people who share your interests. Discover communities you love. Join fun conversations.
2 Hello (Adele song) - Wikipedia [en.wikipedia.org]
"Hello" is a song by English singer Adele, released on 23 October 2015 by XL Recordings as the lead single from her third studio album, 25 (2015). Adele ...
3 Hello Design [www.hellodesign.com]
Hello is a creative agency driven to craft worthy experiences. We believe everything will be digital—surrounding us like the air we breathe. Hello is ...
4 hello - Wiktionary [en.wiktionary.org]
The greeting hello is among the most generic and neutral in use. It may be heard in nearly all social situations and in nearly all walks of life, and is unlikely to ...
5 hello | Definition of hello in English by Oxford Dictionaries [en.oxforddictionaries.com]
Definition of hello - used as a greeting or to begin a telephone conversation.
6 HELLO! - Daily royal, celebrity, fashion, beauty & lifestyle news [www.hellomagazine.com]
HELLO! brings you the latest celebrity & royal news from the UK & around the world, magazine exclusives, fashion, beauty, lifestyle news, celeb babies, ...
7 Hello 4.0.0.0.0 for Android - Download [hello.en.uptodown.com]
Rating: 3.8 - 44 votes
Hello is an official app from Facebook that let's you see all of the information about the telephone numbers that call you. Also, you can block specific numbers or ...
8 hello Meaning in the Cambridge English Dictionary [dictionary.cambridge.org]
hello definition: 1. used when meeting or greeting someone: 2. something that is said at the beginning of a phone conversation: 3. something that is said to ...
9 Hello Games [www.hellogames.org]
We are Hello Games. We make games! Hello! Follow us on TWITTER, read our BLOG! Like us on FACEBOOK! Do you want to post YouTube videos of our ...
googler (? for help)
LGTM.
But, maybe I'm missing something obvious, but why are your results shown as
2 hello network [hello.com]
Connect with people who share your interests. Discover communities you love. Join fun conversations.
rather than
1 hello network
https://hello.com/
Connect with people who share your interests. Discover communities you love. Join fun conversations.
? I don't recall any customization option like this.
Also, I don't get the card result
1 hello - YouTube [www.youtube.com]
22 Aug 2017 - 3 min - Uploaded by Lauv about making a big move, falling in love for the first time, and figuring out your own identity while ...
(--noua
or not). Card skipping code is not working for you?
Hmm, I must have read the git log five times without noticing that commit. Read three more times after you mentioned it. Time to get a new pair of glasses.
Time to get a new pair of glasses.
Boy, I didn't know you wore glasses!