How to extract "partly cloudy" from the paragraph tag <p ngcontent-c4="" >Partly Cloudy </p>

Web scraping through python

16th Jun 2018, 12:14 PM
Sagar Singh
Sagar Singh - avatar
1 Answer
+ 1
List Slices also work on Strings: line = '<p ngcontent-c4="" >Partly Cloudy </p>' print (line[line.index('>')+1:line.index('</')]) # Prints the Part between '>' and Endtag '</' https://www.sololearn.com/learn/Python/2453/?ref=app
28th Jun 2018, 6:47 PM
Sebastian Keßler
Sebastian Keßler - avatar