from bs4 import BeautifulSoup
from urllib import urlopen
player_code = open("/Users/brandondennis/Desktop/money/CF_Name.txt").read()
player_code = player_code.split("r")
for player in player_code:
html =urlopen("https://www.capfriendly.com/players/"+player+"")
soup = BeautifulSoup(html, 'html.parser')
for section in soup.findAll('div',{"class": "table_c"}):
table = section.findChildren()[10].text
print player, table
Here is a link to a sample player page : https://www.capfriendly.com/players/patrik-elias
Here is a sample of player names that I am adding from a text file to the base url.
This is ultimately what I am wanting to do for my text file of 1000+ players
Aucun commentaire:
Enregistrer un commentaire