In: Computer Science
IST 411
1. What are the advantages of using CURL for handling web bot automation?
cURL can do all sorts of tricks in addition to merely downloading files. And cURL is very useful to test with a cookie, RESTful APIs, proxy support, user authentication, FTP upload, HTTP post, SSL connections, cookies, file transfer resume, remotely parsing web pages.
3. What network protocols are supported with CURL?
The URL syntax is protocol-dependent. eg. http{s}://www.name.com
4. What is pycurl and what can you do with pycurl?
py+curl = python + transfer URL -- fetch URL using python programming.
pyURL is a Python interface to libcurl
USES:
5. Write a pycurl example that grabs some Web page HTML content.
import pycurl
from StringIO import StringIO
url = 'http://www.google.com/'
data = StringIO()
c = pycurl.Curl()
c.setopt(c.URL, url)
c.setopt(c.WRITEDATA, data)
c.perform()
c.close()
value = data.getvalue()
print (value)