Author Topic: [Source] extractor.py  (Read 656 times)

0 Members and 1 Guest are viewing this topic.

Offline daxda

  • Peasant
  • *
  • Posts: 114
  • Cookies: 112
  • Not the guy you're looking for
    • View Profile
    • Daxda on Github
[Source] extractor.py
« on: January 20, 2014, 12:30:09 pm »
I've been using this little script for a while now and decided today to improve it and comment it better.
It is a very simple URL extractor, you pass either a URL or a file which contains one URL per line, the script
then extracts all links of the source and stores them.
You are able to iterate over the collected links and redirect the output to a file.

This script used to use a lib called 'urllib2', Phage inspired me to use another lib called 'Requests' it's an awesome lib
and more intuitive than urllib2, thanks Phage for bringing it to my attention!

Usage: extractor.py [-h] (-f FILE | -u URL) [-q]

optional arguments:
  -f FILE, --file FILE  A text file with urls to extract from
  -u URL, --url URL     The url which will be searched for links
  -q, --quiet           Don't print errors that occur, quiet mode.

List of dependencies:
[gist]Daxda/8518554[/gist]
« Last Edit: April 23, 2014, 08:16:21 pm by daxda »