Advertisement
Guest User

2 files

a guest
Aug 3rd, 2017
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.24 KB | None | 0 0
  1. from bs4 import BeautifulSoup
  2. import requests
  3.  
  4. url = "https://marketplace.tf/shop/blindpolarbear"
  5.  
  6. r = requests.get(url)
  7. soup = BeautifulSoup(r.content, "lxml")
  8. items = soup.find_all("item_html_name")
  9. # g_data = soup.find_all("div", {"class": "item-html-nane"})
  10. g_data = soup.find_all("div", {"class": "item-box-name"})
  11.  
  12. # Runs a loop to print all the name of the items.
  13. for g_datas in g_data:
  14.     print(g_datas.text.strip('\n'))
  15.  
  16. link = soup.find_all("a")
  17. for links in link:
  18.     print(links.text)
  19.  
  20.  
  21.  
  22. ------------
  23.  
  24. import time
  25. from selenium import webdriver
  26.  
  27. driver = webdriver.Chrome('/Users/vincechi/chromedriver')  # Optional argument, if not specified will search path.
  28. driver.get('http://www.edmodo.com')
  29. from bs4 import BeautifulSoup
  30. import requests
  31.  
  32. r = requests.get("http://edmodo.com")
  33. soup = BeautifulSoup(r.content, "lxml")
  34. login = driver.find_element_by_id("top-login-button")
  35. login.click()
  36. time.sleep(1)
  37. username = driver.find_element_by_id("un")
  38. username.send_keys('OmsChiv')
  39. time.sleep(1)
  40. password = driver.find_element_by_id("pw")
  41. password.send_keys('Basketball4Life')
  42. confirmlogin = driver.find_element_by_id("lightbox-login")
  43. confirmlogin.click()
  44. Text = soup.find_all("span")
  45. for Texts in Text:
  46.     print(Texts)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement