Slide 25
Slide 25 text
25
import requests
from bs4 import BeautifulSoup as bs
def onoffmix():
with requests.Session() as s:
s.headers = {
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) '
'AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36'
}
login = s.post('https://onoffmix.com/account/login', data={
'email': 'usermail@gmail.com',
'pw': 'mypassword1234',
'proc': 'login'
})
html = s.get('http://onoffmix.com/account/event')
soup = bs(html.text, 'html.parser')
event_list = soup.select('#eventListHolder > div > ul > li.title > a')
for event in event_list:
print(event.text)