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

31st Jul 2018, 8:37 AM
tabish manzoor
tabish manzoor - avatar
1 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)
5th Aug 2018, 7:49 AM
Aidan Haddon-Wright
Aidan Haddon-Wright - avatar