0

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

1
  • What do you mean by "element" and "web page" Commented Nov 10, 2010 at 22:19

4 Answers 4

1

If you are familiar with javascript, you should be familiar with the DOM. This should help you to get the information you want, seeing how this parses HTML, among other things. Then it's up to you to extract the information you need

Sign up to request clarification or add additional context in comments.

Comments

0

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.

Comments

0

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.

Comments

0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.