Editing a URL template

Need help with C, C++, perl, python, etc?

Editing a URL template

Postby mrmantle » 2018-08-29 12:19

Hi Guys,

In my .py file I want to edit this code so I can do my own google searches.

Where abouts do I add my own google search keywords.

# URL templates to make Google searches.
url_home = "https://www.google.%(tld)s/"
url_search = "https://www.google.%(tld)s/search?hl=%(lang)s&q=%(query)s&btnG=Google+Search&tbs=%(tbs)s&safe=%(safe)s&tbm=%(tpe)s"
url_next_page = "https://www.google.%(tld)s/search?hl=%(lang)s&q=%(query)s&start=%(start)d&tbs=%(tbs)s&safe=%(safe)s&tbm=%(tpe)s"
url_search_num = "https://www.google.%(tld)s/search?hl=%(lang)s&q=%(query)s&num=%(num)d&btnG=Google+Search&tbs=%(tbs)s&safe=%(safe)s&tbm=%(tpe)s"
url_next_page_num = "https://www.google.%(tld)s/search?hl=%(lang)s&q=%(query)s&num=%(num)d&start=%(start)d&tbs=%(tbs)s&safe=%(safe)s&tbm=%(tpe)s"
mrmantle
 
Posts: 2
Joined: 2018-08-29 12:14

Re: Editing a URL template

Postby debiman » 2018-08-29 17:55

mrmantle wrote:Where abouts do I add my own google search keywords.

where it says (query).
User avatar
debiman
 
Posts: 3008
Joined: 2013-03-12 07:18

Re: Editing a URL template

Postby mrmantle » 2018-08-30 08:00

So I replace the word query like this (My google search)?
mrmantle
 
Posts: 2
Joined: 2018-08-29 12:14

Re: Editing a URL template

Postby debiman » 2018-08-30 17:55

with or without brackets, yes.
User avatar
debiman
 
Posts: 3008
Joined: 2013-03-12 07:18


Return to Programming

Who is online

Users browsing this forum: No registered users and 1 guest

fashionable