Skip to main content

SOAP google search


>>> from SOAPpy import WSDL
#create a WSDL.Proxy object and point it at your local copy of Google's WSDL file.
>>> server = WSDL.Proxy('./GoogleSearch.wsdl')

According to the WSDL file, Google offers three functions: doGoogleSearch,
doGetCachedPage, and doSpellingSuggestion. These do exactly what they sound
like: perform a Google search and return the results programmatically, get access to the cached
version of a page from the last time Google saw it, and offer spelling suggestions for commonly
misspelled search words.

>>> server.methods.keys()
[u'doGoogleSearch', u'doGetCachedPage', u'doSpellingSuggestion']

The doGoogleSearch function takes a number of parameters of various types. Note that
while the WSDL file can tell you what the arguments are called and what datatype they are, it
can't tell you what they mean or how to use them. It could theoretically tell you the acceptable
range of values for each parameter, if only specific values were allowed, but Google's WSDL
file is not that detailed. WSDL.Proxy can't work magic; it can only give you the information
provided in the WSDL file.

>>> callInfo = server.methods['doGoogleSearch']
>>> for arg in callInfo.inparams:
...     print arg.name.ljust(15), arg.type
...
key             (u'http://www.w3.org/2001/XMLSchema', u'string')
q               (u'http://www.w3.org/2001/XMLSchema', u'string')
start           (u'http://www.w3.org/2001/XMLSchema', u'int')
maxResults      (u'http://www.w3.org/2001/XMLSchema', u'int')
filter          (u'http://www.w3.org/2001/XMLSchema', u'boolean')
restrict        (u'http://www.w3.org/2001/XMLSchema', u'string')
safeSearch      (u'http://www.w3.org/2001/XMLSchema', u'boolean')
lr              (u'http://www.w3.org/2001/XMLSchema', u'string')
ie              (u'http://www.w3.org/2001/XMLSchema', u'string')
oe              (u'http://www.w3.org/2001/XMLSchema', u'string')

Here is a brief synopsis of all the parameters to the doGoogleSearch function:
• key − Your Google API key, which you received when you signed up for Google web services.
• q − The search word or phrase you're looking for. The syntax is exactly the same as Google's web form, so if
you know any advanced search syntax or tricks, they all work here as well.
• start − The index of the result to start on. Like the interactive web version of Google, this function returns
10 results at a time. If you wanted to get the second "page" of results, you would set start to 10.
• maxResults − The number of results to return. Currently capped at 10, although you can specify fewer if
you are only interested in a few results and want to save a little bandwidth.
• filter − If True, Google will filter out duplicate pages from the results.
• restrict − Set this to country plus a country code to get results only from a particular country.
Example: countryUK to search pages in the United Kingdom. You can also specify linux, mac, or bsd to
search a Google−defined set of technical sites, or unclesam to search sites about the United States
government.
• safeSearch − If True, Google will filter out porn sites.
• lr ("language restrict") − Set this to a language code to get results only in a particular language.
• ie and oe ("input encoding" and "output encoding") − Deprecated, both must be utf−8.

Comments

Popular posts from this blog

CKA Simulator Kubernetes 1.22

  https://killer.sh Pre Setup Once you've gained access to your terminal it might be wise to spend ~1 minute to setup your environment. You could set these: alias k = kubectl                         # will already be pre-configured export do = "--dry-run=client -o yaml"     # k get pod x $do export now = "--force --grace-period 0"   # k delete pod x $now Vim To make vim use 2 spaces for a tab edit ~/.vimrc to contain: set tabstop=2 set expandtab set shiftwidth=2 More setup suggestions are in the tips section .     Question 1 | Contexts Task weight: 1%   You have access to multiple clusters from your main terminal through kubectl contexts. Write all those context names into /opt/course/1/contexts . Next write a command to display the current context into /opt/course/1/context_default_kubectl.sh , the command should use kubectl . Finally write a second command doing the same thing into ...

OWASP Top 10 Threats and Mitigations Exam - Single Select

Last updated 4 Aug 11 Course Title: OWASP Top 10 Threats and Mitigation Exam Questions - Single Select 1) Which of the following consequences is most likely to occur due to an injection attack? Spoofing Cross-site request forgery Denial of service   Correct Insecure direct object references 2) Your application is created using a language that does not support a clear distinction between code and data. Which vulnerability is most likely to occur in your application? Injection   Correct Insecure direct object references Failure to restrict URL access Insufficient transport layer protection 3) Which of the following scenarios is most likely to cause an injection attack? Unvalidated input is embedded in an instruction stream.   Correct Unvalidated input can be distinguished from valid instructions. A Web application does not validate a client’s access to a resource. A Web action performs an operation on behalf of the user without checkin...