Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fetch data from a web page
#1
Hello!

I´d appreciate it if you could help me out.

I need to fetch air pollutant concentrations from the following site:

http://siga.jalisco.gob.mx/ramag/ImecasParticulasR.aspx

I tryed the following code, but, since the concentrations are not in the main html, I get nothing.


import urllib
import re

htmlfile = urllib.urlopen('The site above')

htmltext = htmlfile.read()

print htmltext

regex = '<div style="WIDTH:223.48mm;">(.+?)</div>'

pattern = re.compile(regex)


print pattern

con = re.findall(pattern, htmltext)


print con
Reply
#2
I tryied this just to see if I could retrieve something, but I only get an empty list.


import urllib
import re

htmlfile = urllib.urlopen('http://siga.jalisco.gob.mx/aire/tablasCon.html')

htmltext = htmlfile.read()

print htmltext

regex = '<div style="WIDTH:223.48mm;">(.+?)</div>'

pattern = re.compile(regex)


print pattern

con = re.findall(pattern, htmltext)


print con
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to display variable serial data on Tkinter window. srinivas.rambha 0 924 06-17-2013, 05:54 AM
Last Post: srinivas.rambha
  Python script pulling data from XML file for Eve-Online data J4P4NM4N 1 2,916 11-10-2009, 10:29 PM
Last Post: J4P4NM4N

Forum Jump:


Users browsing this thread: 1 Guest(s)