Python Hacking Tools - Web Scraper

Preparation:

Python Libray in the following programming:

1. Requests Document: https://2.python-requests.org//en/master/

2. Beautiful Soup Documentation: https://www.crummy.com/software/BeautifulSoup/bs4/doc/

Install the lib on Kali Linux:

apt-get install python-requests

apt-get install python-bs4

Python Hacking Tools - Web Scraper

Proxy Domain:

https://free-proxy-list.net/

Python Hacking Tools - Web Scraper

 

 Python Scraper Code:

import requests
from bs4 import BeautifulSoup

proxyDomain = "https://free-proxy-list.net/"

requests.get(proxyDomain)

soup = BeautifulSoup(r.content, 'html.parser')

table = soup.find('table', {"id" : "proxylisttable"})

for row in table.find_all('tr'):
    columns = row.find_all('td')
    try:
        print "%s:%s\t%-40s\t%-10s" %(columns[0].get_text(),columns[1].get_text(),columns[2].get_text(),columns[3].get_text())
    except:
        pass

 

上一篇:CF796C Bank Hacking 细节


下一篇:HTML5随堂笔记(一)