Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fiddler does not capture my script's requests

Tags:

python

fiddler

my code:

proxy = urllib2.ProxyHandler({'http': '127.0.0.1:8888'})
opener = urllib2.build_opener(proxy)
urllib2.install_opener(opener)
f = urllib2.urlopen('http://www.google.com')
print f.read()
this request does not show in Fiddler's capture, does anyone know how to configure Fiddler so that the request is captured?

EDIT: the request works, and I can see the contents. Also, if I close Fiddler, the request fails, as expected, because there is no proxy. It is just that I do not see anything in Fiddler.

EDIT2: I see traffic from a .NET test console application that I wrote. But I do not see traffic from my python script.

like image 740
akonsu Avatar asked May 20 '26 22:05

akonsu


1 Answers

I got the exactly the same issue, when fiddler2 opens, even I change proxy = urllib2.ProxyHandler({'http': 'http://asdfl.com:13212/'}) (such none existing proxy server), it still can get the page content, I guess maybe when proxy server has been setup by fiddler2, urllib2 totally ignore the ProxyHandler for some reason, still can't figure out.


I got it, check that thread in stackoverflow: urllib2 doesn't use proxy (Fiddler2), set using ProxyHandler

In Fiddler2, go to the page Tools->Fiddler Options ...->Connections, remove the trailing semicolon from the value in the "IE should bypass Fiddler for ..." field and restart Fiddler2.

this solution solved my problem, hope can help someone if you are struggling with it.

like image 189
Box Very Avatar answered May 22 '26 11:05

Box Very



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!