Reputation: 11281
I would like to access any element in a web page. I know how to do that when I have a form (form = cgi.FieldStorage()
), but not when I have, for example, a table.
How can I do that?
Thanks
Upvotes: 0
Views: 194
Reputation: 7102
You can access only data, posted by form (or as GET parameters).
So, you can extract data you need using JavaScript and post it through form
Upvotes: 0
Reputation: 50943
The way to access a table is to parse the HTML. This is different from accessing form data, in that it's not dynamic. Since you mentioned CGI, I'm assuming you're working on the server side of things and that you have the ability to serve whatever content you want. So you could use whatever data you're representing in the table in its raw form before turning it into HTML too.
Upvotes: 0
Reputation: 76955
HTML parsing using either HTMLParser
or Beautiful Soup if you're trying to get data from a web page. You can't really write data to an HTML table like you could do with CGI and forms, so I'm hoping this is what you want.
I personally recommend Beautiful Soup if you want intelligent parsing behavior.
Upvotes: 0