Irlance_Dox

BOX1

Oct 4th, 2017
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.82 KB | None | 0 0
  1. import requests
  2. from bs4 import BeautifulSoup
  3. from selenium import webdriver
  4.  
  5. url = 'http://matchhistory.na.leagueoflegends.com/en/#match-details/TRLH1/1002360518?gameHash=bbf7271d795c1a05&tab=overview'
  6.  
  7.  
  8. driver = webdriver.PhantomJS(executable_path="D:/phantomjs-2.1.1-windows/bin/phantomjs")
  9. driver.get(url)
  10. pageSource = driver.page_source
  11. # print(pageSource)
  12. soup = BeautifulSoup(pageSource, 'html.parser')
  13.  
  14. y = 0
  15. for data in soup.select('span'):
  16.     # print(data.text)
  17.     if y == 1:
  18.         GameTime = data.text
  19.     if y == 2:
  20.         Date = data.text
  21.         break
  22.     y = y + 1
  23.  
  24. print('Time: ' + GameTime)
  25. print('Date: ' + Date)
  26.  
  27. x = 0
  28. for item in soup.select('.champion-nameplate-icon div'):
  29.     # print(item['title'])
  30.     print(item)
  31.     x = x + 1
  32.     if x == 20:
  33.         break
  34. driver.close()
Advertisement
Add Comment
Please, Sign In to add comment