Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- from bs4 import BeautifulSoup
- from selenium import webdriver
- url = 'http://matchhistory.na.leagueoflegends.com/en/#match-details/TRLH1/1002360518?gameHash=bbf7271d795c1a05&tab=overview'
- driver = webdriver.PhantomJS(executable_path="D:/phantomjs-2.1.1-windows/bin/phantomjs")
- driver.get(url)
- pageSource = driver.page_source
- # print(pageSource)
- soup = BeautifulSoup(pageSource, 'html.parser')
- y = 0
- for data in soup.select('span'):
- # print(data.text)
- if y == 1:
- GameTime = data.text
- if y == 2:
- Date = data.text
- break
- y = y + 1
- print('Time: ' + GameTime)
- print('Date: ' + Date)
- x = 0
- for item in soup.select('.champion-nameplate-icon div'):
- # print(item['title'])
- print(item)
- x = x + 1
- if x == 20:
- break
- driver.close()
Advertisement
Add Comment
Please, Sign In to add comment