pycurl

Trouble with pycurl.POSTFIELDS

I'm familiar with CURL in PHP but am using it for the first time in Python with pycurl. I keep getting the error: Exception Type: error Exception Value: (2, '') I have no idea what this could mean. Here is my code: data = {'cmd': '_notify-synch', 'tx': str(request.GET.get('tx')), 'at': paypal_pdt_test ...

Mod_Python + Django library import issue

Hello, I recently had a site that was running perfect for months, all of a sudden it decided to dump itself for no approximate reason. I am running django + mod_python + apache, and the system decided it was time to start ignoring the import of the pycurl library, my intial first thought was that somehow the library had become corrupte...

Python: urllib2 or Pycurl?

I have extensive experience with PHP cURL but for the last few months I've been coding primarily in Java, utilizing the HttpClient library. My new project requires me to use Python, once again putting me at the crossroads of seemingly comparable libraries: pycurl and urllib2. Putting aside my previous experience with PHP cURL, what is ...

Screen scraping with Python

Does Python have screen scraping libraries that offer JavaScript support? I've been using pycurl for simple HTML requests, and Java's HtmlUnit for more complicated requests requiring JavaScript support. Ideally I would like to be able to do everything from Python, but I haven't come across any libraries that would allow me to do it. Do...

Logging in and using cookies in pycurl

I need to download a file that is on a password protected page. To get to the page manually I first have to authenticate via an ordinary login page. I want to use curl to fetch this page in script. My script first logins. It appears to succeed--it returns a 200 from a PUT to /login. However, the fetch of the desired page fails, with a...

pycurl install :( already have min. libcurl version

I'm running python 2.6 on an Intel Mac OS X 10.5 I'm trying to install pycurl 7.16.2.1 (as recommended here http://curl.haxx.se/mail/curlpython-2009-03/0009.html), but for some reason, the installation sees my libcurl 7.16.3, yet it still insist I install 7.16.2 or greater (doesn't 7.16.3 satisfy that?) Here's the error output: Runnin...

pycurl and lot of callback functions

I have big URL list, which I have to download in parallel and check one of headers that is returned with each response. I can use CurlMulti for parallelization. I can use /dev/null as fb, because I am not interested in body, only headers. But how can I check each header? To receive header, I must set HEADERFUNCTION callback. I get tha...

python library for file upload and persistent connections?

Hi, I tried urllib{2}, pycurl and I'm looking at twisted's new http client. But: I found urllib2 difficult to perform a file upload pycurl multi looks right but unpythonic twisted's http client does not support persistent connection (didn't check the file upload capability) Is there any other alternative? ...

Which is best in Python: urllib2, PycURL or mechanize?

Ok so I need to download some web pages using Python and did a quick investigation of my options. Included with Python: urllib - seems to me that I should use urllib2 instead. urllib has no cookie support, HTTP/FTP/local files only (no SSL) urllib2 - complete HTTP/FTP client, supports most needed things like cookies, does not support ...

pycurl READFUNCTION with a bytestream

Is there a way to write a callback function for pycurl's READFUNCTION that does not return a string? I am planning on sending blocks of binary data via pycurl. i tried writing a callback function that does this: def read_callback(self, size): for block in data: yield block but pycurl exits with an error that says the return type...

How do I resolve this curl-related error?

please tell me the solution Traceback (most recent call last): File "<stdin>", line 1, in <module> File "build/bdist.linux-x86_64/egg/pycurl.py", line 7, in <module> File "build/bdist.linux-x86_64/egg/pycurl.py", line 6, in __bootstrap__ ImportError: libcurl.so.4: cannot open shared object file: No such file or directory ...

How do I install pyCurl?

Hi folks! I tried everything! I cannot find a way to install pyCurl on my Windows 7 machine! I found these binaries link... BUT there are no binaries for 2.6. : ( Help would be great. : ) ...

Installing Pycurl on CentOS?

Hi folks, I'm finding it to install pycurl on CentOS 5 quite the mission impossible. This is the error I'm getting: >>> import pycurl Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: libcurl.so.4: cannot open shared object file: No such file or directory Some help would be beyond amazing. :| ...

How to get HTTP status message in (py)curl?

spending some time studying pycurl and libcurl documentation, i still can't find a (simple) way, how to get HTTP status message (reason-phrase) in pycurl. status code is easy: import pycurl import cStringIO curl = pycurl.Curl() buff = cStringIO.StringIO() curl.setopt(pycurl.URL, 'http://example.org') curl.setopt(pycurl.WRITEFUNCTION, ...

Symbol not found: _curl_easy_cleanup

I am working on porting a python application to Mac OS X. The application makes use of pycurl and PyCDF. When I run my code, I get this error : > File > "/Library/Python/2.5/site-packages/pycdf/pycdfext.py", > line 5, in <module> > import _pycdfext ImportError: dlopen(/Library/Python/2.5/site-packages/pycdf/_pycdfext.so, > 2): Symb...

Problem trying to install PyCurl on Mac Snow Leopard

Hi, My app needs to use PyCurl, so i tried to install it on my Mac but i found a lot of problems and error :( Requirement: First of all i've to say that the version of Python working on my Mac is 32 bit based, because i need to use WxPython, that needs 32 bit Python. For doing this i used: defaults write com.apple.versioner.python Pre...

Uploading file from file object with PyCurl

I'm attempting to upload a file like this: import pycurl c = pycurl.Curl() values = [ ("name", "tom"), ("image", (pycurl.FORM_FILE, "tom.png")) ] c.setopt(c.URL, "http://upload.com/submit") c.setopt(c.HTTPPOST, values) c.perform() c.close() This works fine. However, this only works if the file is local. If I was to fetc...

pycurl: how to reset a cookie session

Hello, everybody I'm using the following piece of code to get the content of a webpage from python script: #!/usr/bin/env python import pycurl import StringIO c = pycurl.Curl() c.setopt(pycurl.URL, "http://google.com") b = StringIO.StringIO() c.setopt( c.WRITEFUNCTION, b.write) #c.setopt(pycurl.COOKIESESSION, True); c.setopt(pycurl.CO...

PycURL RESUME_FROM

I can't seem to get the RESUME_FROM option to work. Here's some example code that I have been testing with: import os import pycurl import sys def progress(total, existing, upload_t, upload_d): try: frac = float(existing)/float(total) except: frac = 0 sys.stdout.write("\r%s %3i%%" % ("file", frac*100) ) ur...

Custom headers with pycurl ?

Hi i'm wondering if i can send a custom header like "yadayadayad" to the server with the pycurl requsest ? Thanks :) ...