Hi everyone I am currently trying to get some data from urls and then trying to predict what category should that article belong. So far I have done this but it has an error:
info = pd.read_csv('labeled_urls.tsv',sep='\t',header=None)
html, category = [], []
for i in info.index:
response = requests.get(info.iloc[i,0])
soup = BeautifulSoup(response.text, 'html.parser')
html.append([re.sub(r'<.*?>','',
str(soup.findAll(['p','h1','\href="/avtorji/'])))])
category.append(info.iloc[0,i])
data = pd.DataFrame()
data['html'] = html
data['category'] = category
And the error is this:
IndexError: single positional indexer is out-of-bounds.
Can someone help me please?