curl-and-python

Re: new to curl

From: Kjetil Jacobsen <kjetilja_at_gmail.com>
Date: Fri, 6 Apr 2007 10:18:17 +0200

hi,

perhaps something like the following example would work? (assuming a
unix platform):
"""
import pycurl
c = pycurl.Curl()
c.setopt(c.URL, 'http://curl.haxx.se/dev/')
c.setopt(c.WRITEFUNCTION, open('/dev/null', 'w').write)
c.perform()
print c.getinfo(c.EFFECTIVE_URL)
c.close()
"""

regards,
    - kjetil

On 4/5/07, Khalil KHAMLICHI <kontactel.support_at_gmail.com> wrote:
> My problem is as follows :
> i need to query a database on some website & gather the responses into a
> text file.
> i would for example query this database for let's says the word "dinner";
> then what i need to know is only the url that i get back from the database,
> i don't really need to know what is the content of the page i get. i only
> need to get the url into my text file right next to the word i already had
> posted in my query.
>
> example text file resulting should look like:
>
> dinner
> http://my_db_website.com/this_is_response_x.asp
> breakfast
> http://my_db_website.com/this_is_response_y.asp
> joke
> http://my_db_website.com/this_is_response_z.asp
> house
> http://my_db_website.com/this_is_response_e.asp
>
> which will be injected into another database for further treatment.
>
> well, its this simple.
> I hope i get many replies that would help me get it done as soon as
> possible.
>
> thanks in advance
> _______________________________________________
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python
>
>
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python
Received on 2007-04-06