How to get html tag value in python
I'm newbie to python. Here is my code working on python 2.7.5 Show
Getting HTML markup like that and it works. What I want to do is, to get value from inside
How to do it?
asked Sep 6, 2013 at 11:38
1 You can use a HTML parser module such as
This finds a tag answered Sep 6, 2013 at 11:39
TerryATerryA 56.9k11 gold badges117 silver badges137 bronze badges 2 Using
answered Sep 6, 2013 at 11:40
falsetrufalsetru 343k57 gold badges683 silver badges606 bronze badges View Discussion Improve Article Save Article View Discussion Improve Article Save Article Prerequisites: Beautifulsoup In this article, we will discuss how beautifulsoup can be employed to find a tag with the given attribute value in an HTML document. Approach:
Below are some implementations of the above approach: Example 1: Python3
Output: div Example 2: Python3
Output: a Example 3: Python3
Output: p |