0
votes

I need to write a Python script that will use data from a website like this link and put it into a pandas dataframe.

My try is

import pandas as pd
import numpy as np
import requests

from bs4 import BeautifulSoup

url = "https://www.w3schools.com/sql/trysql.asp?filename=trysql_op_in"

r =  requests.get(url)

soup = BeautifulSoup(r.text, 'html.parser')

league_table = soup.find('table', class_ = "table.ws-table-all.notranslate")

print(league_table)

And I got output: None

maybe its the wrong link, if I open the one you posted and look at the HTML, I do not see any table having the class attribute you specifiedmarcel h
The thing is get table it should be sql statement "SELECT * FROM [Customers]", than by checking html code it appears. Maybe it is possible to get data from Web sql, but i cannot find a solution how to do itAndrew Yakovlev