Jesús León
Jesús León

Reputation: 157

Get requests from website

I'm trying to intercept all the requests received by a website, to get a certain file. For example, when you use Firefox's network monitor. Can I do that in Python? Sorry for being so vague. I'd like to get all the URLs that the website requests, like you can see in the picture. Example: the favicon, js files, xml files, etc.

Example:

Firefox -> Tools -> Dev Tools > Network

Upvotes: 0

Views: 132

Answers (1)

myaut
myaut

Reputation: 11494

So you probably need a packet sniffer like tcpdump. The best python sniffer I know is scapy. Here is in example of how HTTP may be sniffed with it: http://www.r00tsec.com/2013/12/simple-sniffer-http-request-and-http.html

Note that you couldn't do that trick with HTTPS. Also packet sniffing usually requires root privileges on a host system.

Upvotes: 1

Related Questions