0
Hello,
I am trying to return the link list found in HTML with the python script below. When run in the Python IDE, the result returns all found occurrences. When running on Power Bi Desktop, the result returns only 1 line.
Script:
import requests
from bs4 import BeautifulSoup
import pandas as pd
req = requests.get("https://python.org")
html = req.text
soup = BeautifulSoup(html, 'html.parser')
for lnk in soup.select('link'):
l = lnk.get('href')
if len(l) > 0:
base = pd.DataFrame({'link':[l]}, index=['link'])
Result in Power BI
Output in Python IDE
My question is: does the script have to be modified to bring the results through Power Bi? In Power Bi, the "for" loop does not work as in the IDE ?
Thank you @Bruno Rodrigues Silva. It worked correctly with your tip to put the dataframe out of the loop. I’m started in power BI and python.
– Carine Consantino