Advertisement
Mr_hEx

Untitled

Jul 4th, 2020
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.53 KB | None | 0 0
  1. import requests
  2. from bs4 import BeautifulSoup
  3.  
  4. def New_URL(x):
  5.     soup = BeautifulSoup(x.text, 'html.parser')
  6.     url_with_Tag = str(soup.find_all("div", class_="load-more-wrapper"))
  7.     url_half_Tag = url_with_Tag[43:]
  8.     index_of_End = url_half_Tag.find(">")
  9.     count_char = 0
  10.     URL_char = []
  11.     for i in url_half_Tag:
  12.         count_char +=1
  13.         if count_char < index_of_End:
  14.            URL_char.append(i)
  15.     URL_final = ''.join(URL_char)
  16.     #print("[+] URL : {}".format(URL_final.replace("amp;","")))
  17.     URL_final2 = URL_final.replace("amp;","")
  18.     return URL_final2;
  19.  
  20.  
  21.  
  22. def Get_user(x):
  23.          try:
  24.             soup = BeautifulSoup(x.text, 'html.parser')
  25.             for XX in range(500):
  26.                 user_with_Tag = str(soup.find_all("span", class_="followers_username")[XX])
  27.                 user_half_Tag = user_with_Tag[33:]
  28.                 index_of_End = user_half_Tag.find("<")
  29.                 count_char = 0
  30.                 user_char = []
  31.                 for i in user_half_Tag:
  32.                     count_char +=1
  33.                     if count_char < index_of_End:
  34.                        user_char.append(i)
  35.                 user_final = ''.join(user_char)
  36.                 print("[+] user : {}".format(user_final))
  37.          except:
  38.                 print("[+] Loading more users Please wait !!")
  39.  
  40. for ZZ in range(10):
  41.     Url = 'https://www.picuki.com'
  42.     url_tmp = '/followers/cristiano'
  43.     url_Final = Url+url_tmp
  44.     x = requests.get(url_Final)
  45.     Get_user(x)
  46.     url_tmp = New_URL(x)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement