Shkruaj një skenar për të nxjerrë informacionet e aksioneve.
import request import lxml.html as lh import pandas as pd url = 'https://finance.yahoo.com/quote/AAPL/' page = requests.get(url) doc = lh.fromstring(page.content) column_headers = [] for col in doc.xpath('//table[@class="W(100%) M((c) ]//tr[1]//th'): column_headers.append(col.text_content).strip)) table_rows = doc.x'//tr[@class = "BdT Bdc(seperatorColor) Ta) Fznwstarts) Whs) ]') data = [data] for row in table: data = data for col.x.append (data) row: data for row (data) in col.x.append (data) row (data) in col.x.append (data))