0
I’m collecting the data on this one website, using requests and beautifulsoup. I was able to collect all the data from page 1, but I cannot change the page.
Python code
variaveis = []
df_list = []
for i in range(1,3):
print('rodada')
print(i)
url = 'https://www.cartolafcbrasil.com.br/scouts/cartola-fc-2018/rodada-' + str(i)
page = requests.get(url)
soup = BeautifulSoup(page.text, 'html.parser')
table = soup.find_all('table')[0]
df = pd.read_html(str(table), encoding="UTF-8")
df_list.append(df)
print(df)
HTML
<tr class="tbpaging">
<td colspan="25">
<table border="0">
<tr>
<td>
<span>
1
</span>
</td>
<td>
<a href="javascript:__doPostBack('ctl00$cphMainContent$gvList','Page$2')">
2
</a>
</td>
<td>
<a href="javascript:__doPostBack('ctl00$cphMainContent$gvList','Page$3')">
3
</a>
</td>
Soup.find_element_by_xpath("(//a[contains(.,'2')])[2]"). click() 'Nonetype' Object is not callable
– Pedro
@Pedro with Soup you won’t be able to run javascript.
– Augusto A