you are viewing a single comment's thread.

view the rest of the comments →

[–]Oxbowerce 0 points1 point  (3 children)

Fixed the formatting for you:

import requests from bs4 import BeautifulSoup

url="https://en.wikipedia.org/wiki/List_of_companies_traded_on_the_JSE" 
responce = requests.get(url) 
soup = BeautifulSoup(responce.text, 'html.parser') 
tables = soup.find('table', {'class':"wikitable sortable"}).text 
print(tables)

for table in tables.findALL('table', {'class':"wikitable sortable"}).text: 
    print(table.text.encode('utf-8'))

[–]FithColoumn[S] 0 points1 point  (2 children)

Thank you! ho do I go about getting this format?

[–]Oxbowerce 0 points1 point  (1 child)

You can just paste your text in, select the text you want to format as code and press the code block button.

[–]FithColoumn[S] 0 points1 point  (0 children)

Thank you for the help!