'Python in power BI to get data does not give data

I have a Python script to get data from a website. This works perfect in Visual Studio Code. Now I run the same in Power BI. It does not give me an error bust I do not get data at all.

This is my piece of code to create the dataset:

    table = driver.find_element(By.CLASS_NAME, 'ContentTable')
    rows = table.find_elements_by_tag_name('tr')

    row_num = 0
    l = []
    for row in rows:
        if row_num > 0:
            td = row.find_elements(By.TAG_NAME, "td")
            row2 = [row.text for row in td]
            l.append(row2)
        row_num = row_num + 1
    df = pd.DataFrame(l, columns=["A", "B", "C", "D", "E"],dtype=object)  
    raise Exception(df)
    #print(df)

In Visual studio, I get 21 rows in "df" PowerBI does not create the dataset.

What can be the difference?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source