It's look difficult to me to scrap data from website and that data is inside a table. I use BeautifulSoup and urllib from Python and when i run the program, it's look like this IndexAceh5.82Bali6.23Banten5.85Bengkulu4.81DKI6.
. How i can remove Index
, split word like Aceh
and number 5.82
into something like this
prov = ['Aceh', 'Bali']
number = [5.82, 6.23]
and this is my code and website link :
import urllib2
from bs4 import BeautifulSoup
quote_page = "MY LINK"
page = urllib2.urlopen(quote_page)
soup = BeautifulSoup(page, "html.parser")
pemerintah = soup.find("table", attrs={"cellspacing": "0"}); #cellspacing="0"
name = pemerintah.text.strip()
print name
I found same case in here, but when i try, it not working because on my case i have .
and if i use ade12.3
for example it will give me result ade, 12
, not ade, 12.3