Advertisement
Guest User

Untitled

a guest
Aug 21st, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. list1 = (a,b,c,d)
  2. list2 = (1,2,3,4)
  3. resultList = (a1,b2,c3,d4)
  4.  
  5. #--------------------------------------------------------------------------------
  6. import MySQLdb
  7. from bs4 import BeautifulSoup
  8. import requests
  9.  
  10. #link ---------------------------------------------------------------------------
  11. r1 = requests.get("http://www.metalinjection.net/")
  12. data1 = r1.text
  13. soup1 = BeautifulSoup(data1, "lxml")
  14.  
  15. news1 = soup1.find_all("article", {"class": "post"})
  16. links1 = []
  17. for link in news1:
  18. links1.append(link.a['href'])
  19. # <a href = "link1">some text</a>
  20. description1 = []
  21. for desc in news1:
  22. description1.append(desc.contents[3].find_all("p")[1].text)
  23.  
  24. zip1 = zip(reversed(description1) , reversed(links1))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement