I am trying to pull data from below site and export into excel. I tried to pull data but i am getting more than what i want and i cant able to save into excel that data.
import requests
from BeautifulSoup import BeautifulSoup
url_libor = 'http://online.wsj.com/mdc/public/page/2_3020-libor.html'
response_libor = requests.get(url_libor)
html_libor = response_libor.content
soup1_libor = BeautifulSoup(html_libor)
table_libor = soup1_libor.find('table', attrs={'style': 'border-top:0px solid #CCCCCC;border-bottom:0px;'})
table_libor1 = soup1_libor.find('div', attrs={'class': 'tableDesc'})
table_libor1.append(table_libor)
print table_libor1.prettify()
getting in HTML format but i want in table format. First part of the table
Libor Rates (USD) Latest Wk ago High Low
Libor Overnight 0.68889 0.69278 0.69544 0.3657
Libor 1 Week 0.72206 0.71944 0.72428 0.3866
Libor 1 Month 0.77111 0.76778 0.77667 0.425
Libor 2 Month 0.84694 0.83667 0.85111 0.5128
Libor 3 Month 1.03789 1.02372 1.04344 0.6126
Libor 6 Month 1.35239 1.33294 1.35822 0.85785
Libor 1 Year 1.72122 1.70178 1.73289 1.1156