Can anyone send me the python scrip for scraping paragraphs and contents in tables please | Sololearn: Learn to code for FREE!

0

Can anyone send me the python scrip for scraping paragraphs and contents in tables please

7/31/2018 8:37:10 AM

tabish manzoor

1 Answer

New Answer

+1

I'm not going to give you the code, but I'll give you a few pointers. you can use the re module for matching text within HTML tags. to match all text within a p tag you can do re.search('<p>(.*?)</p>', htmltext) to match everything inside a table you can do: re.search('<table>(.*?)</table>', htmltext, re.DOTALL | re.MULTILINE) to match all table headers: re.findall('<th>(.*?)</th>', htmltext)