robjones90

Markus3

Oct 12th, 2020
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.56 KB | None | 0 0
  1.  
  2. import grequests
  3. from bs4 import BeautifulSoup
  4.  
  5. list_of_links = []
  6.  
  7. for x in range(1, 418):
  8.     var = ("https://www.peopleperhour.com/services/guest+post?page=%s&ref=search" %x)
  9.     list_of_links.append(var)
  10.  
  11. reqs = (grequests.get(link) for link in list_of_links)
  12. resp=grequests.imap(reqs, grequests.Pool(50))
  13.  
  14. for r in resp:
  15.    soup = BeautifulSoup(r.text, 'html.parser')
  16.    results = soup.find_all('div', class_="offer__wrapper⤍OfferListItem⤚2N0Og")
  17.    for item in results:
  18.         print(item.find('a')['title'])
  19.         print(item.find('a')['href'])
Add Comment
Please, Sign In to add comment