Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #48039

Re: Having a hard time to 'get' bing api search results

References <CAJ=2b05Vooh1V3ZOijtS0Y4AwKLSQdbiRhOKkqwzKi_dJ_3m6w@mail.gmail.com> <CAJ=2b06XgZjYs=vDayBTKTJsASeqJZkXiVQfvucqwBsrQAkGnw@mail.gmail.com> <CCED9463-4567-4774-A3BD-D7867D3A275E@studiosola.com>
Date 2013-06-13 18:50 -0400
Subject Re: Having a hard time to 'get' bing api search results
From "Yves S. Garret" <yoursurrogategod@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.3239.1371163834.3114.python-list@python.org> (permalink)

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

That works beautifully!  Thank you!

I do have one question, what are urllib and urllib2 then?  I figured that
urllib2 is a newer version of the previous library (and one that I should
be using).  Am I missing something?


On Thu, Jun 13, 2013 at 6:45 PM, Kevin LaTona <lists@studiosola.com> wrote:

>
> I did a quick test with url lib instead of urllib2 and got closer.
>
> Problem right now is without ID code I can't check any further.
>
> But it does look promising at this point.
>
>
> If all else fails http://docs.python.org/2/library/urllib.html#examples
>
>
> import urllib
>
> f = urllib.urlopen('
> https://user:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA@api.datamarket.azure.com/Bing/SearchWeb/Web?Query=%27xbox%20one%27&$top=50&$format=JSON'
> )
>
> print f.read()
>
>
>
> IOError: ('http error', 401, 'The authorization type you provided is not
> supported.  Only Basic and OAuth are supported',
>
>
>
>
>
> On Jun 13, 2013, at 2:31 PM, Yves S. Garret <yoursurrogategod@gmail.com>
> wrote:
>
> This is the format that I've been following:
>
> http://gavinmhackeling.com/blog/2012/05/using-the-bing-search-api-in-python/
>
> If I execute the specified query from a browser, the JSON file
> shows up without a problem.  Now, I'd like to do that programmatically.
>
>
> On Thu, Jun 13, 2013 at 4:57 PM, Yves S. Garret <
> yoursurrogategod@gmail.com> wrote:
>
>> Hello all,
>>
>> This is my dilemma, I'm trying to get the generated JSON file using the
>> bing api
>> search.
>>
>> This is the code that I'm executing from inside the shell:
>> http://bin.cakephp.org/view/460660617
>>
>> The port doesn't matter to me.  Thoughts?
>>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
>
>

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Having a hard time to 'get' bing api search results "Yves S. Garret" <yoursurrogategod@gmail.com> - 2013-06-13 18:50 -0400

csiph-web