How to find all tags and strings in a document using find_next()?

0 votes

I am trying to find all the tags and string in a document after a particular element. I am using find_next() for this. 

name.find_next("p")

But the problem is that it is finding only the first element. How to find all elements?

May 14 in Python by Kumar
30 views

1 answer to this question.

0 votes

You can use the find_all_next() to do this. Try this:

name.find_all_next(string=True)

It should work.

answered May 14 by Robin

Related Questions In Python

0 votes
1 answer
0 votes
1 answer
–1 vote
2 answers

How to find the size of a string in Python?

following way to find length of string  x ...READ MORE

answered Mar 29 in Python by rajesh
• 1,210 points
94 views
0 votes
1 answer

How to find index from raw and column in python?

You probably want to use np.ravel_multi_index: import numpy as ...READ MORE

answered Sep 12, 2018 in Python by Priyaj
• 56,900 points
69 views
0 votes
1 answer

How to parse html file to BeautifulSoup?

Hey. Refer to the following code: driver.get("link") html = ...READ MORE

answered Apr 2 in Python by Kirti
42 views
0 votes
3 answers
0 votes
1 answer

how to find files and skip directories in os.listdir

You need to filter out directories; os.listdir() ...READ MORE

answered Mar 6 in Python by SDeb
• 13,160 points
161 views