#πŸ”’ web scraping from wikipedia

28 messages Β· Page 1 of 1 (latest)

silver iron
#

https://paste.pythondiscord.com/R2VA
if you look at the wikipedia site, there is a table for land borders. Currently how far i got is printing both the country, and then the land borders, but i want is 1. first only check country or territory, and then after that get all the land neighbours of that country
thank you very much!

tight orchidBOT
#

@silver iron

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

silver iron
#

ill look at this appreciate the help bro!

steel forum
#

πŸ’

#

oh and apparently I'm using pandas.read_html too

silver iron
steel forum
#

well, "pandas" is a library, just like "requests" or "beautifulsoup"

#

"read_html" is one of the functions that it provides

#

I'm using that function

silver iron
#

ahh i see, thats alright with me

#

if it works πŸ˜‚

steel forum
#

works for me!

quick hatch
#

i think i've manually parsed at least one HTML table in my age πŸ₯΄

steel forum
#

I will bet you you wind up with something similar, since I imagine all the tables in wikipedia follow the same structure

civic gazelle
#

why are u scraping wikipedia btw? they have a free rest api for use

steel forum
steel forum
quick hatch
steel forum
#

can't remember the details

silver iron
civic gazelle
civic gazelle
steel forum
#

(or else I tried it and gave up on it long ago and then forgot about it)

tight orchidBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.