Advertisement
Guest User

Untitled

a guest
Jun 8th, 2018
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.66 KB | None | 0 0
  1. import sys
  2. import requests
  3. from pyquery import PyQuery as pq
  4.  
  5. base_url = "https://builtwith.com/"
  6.  
  7. if __name__ == "__main__":
  8.     if len(sys.argv) < 2:
  9.         print("usage: python buildwith.py <url>")
  10.         sys.exit(0)
  11.     full = False if len(sys.argv) < 3 else True
  12.  
  13.     p = pq(requests.get(base_url + sys.argv[1]).text)
  14.  
  15.     for c in p(".span8").children():
  16.         if "title" in c.attrib["class"]:
  17.             print '\n', c.getchildren()[0].getchildren()[0].getchildren()[0].text
  18.         elif "tech" in c.attrib["class"]:
  19.             print '-', c.getchildren()[0].getchildren()[1].text
  20.         if full:
  21.             print "\t", c.getchildren()[2].text
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement