Home > other >  Python output without a label after get the result
Python output without a label after get the result

Time:10-15

Crawl site temperature information
Weather_wd=soup. The.findall (' div '{' class' : "wdtemp"})
Print (weather_wd)
The output
[& lt; div & gt;
~ & lt; Span & gt; 13 & lt;/span>
]

Want to output the results are as follows:
11 to 16
To teach without a label how to change the result of the


CodePudding user response:

"& lt; . *?> \ d +? <. *? & gt;"

CodePudding user response:

A novice to a stupid way to

Crawl site temperature information
Weather_wd=soup. The.findall (' div '{' class' : "wdtemp"})

The second match: the result of the weather_wd
Ma1=re. The.findall (' \ d +, weather_wd)
Print (ma1 [0], '~' ma1 [1])
  • Related