0

I am trying to get, some values from pycurl response because some different protocols produce some errors like

pycurl Error: [1] Protocol tel not supported or disabled in libcurl

I have to use followlocation 1 and, has different protocol like tel: i have to get just location of value, not to follow that link, is this possible?

I tried to get this value with,

def header(self,buf):
    self.HEADER_BUFFER = buf

c.setopt(pycurl.HEADERFUNCTION, self.header)

But couldn't get any data with this method.

Sam
  • 7,252
  • 16
  • 46
  • 65
user2136174
  • 119
  • 1
  • 4
  • 12

1 Answers1

1

Use this two pycurl options:

c.setopt(pycurl.CURLOPT_HEADER, 1) ## return Response header
c.setopt(pycurl.FOLLOWLOCATION, 0) ## no redirect handling

Now at the response result on your pycurl, you find a Response header Location: .... From there parse your link that you wanted.

Sabuj Hassan
  • 38,281
  • 14
  • 75
  • 85