Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Python 

retrieving data from tags

how do i retrieve the 68 from this tag using BeautifulSoup on python 3 ?any help would be greatly appreciated.

<a href="Website">London, United Kingdom<span class="temp">68&deg;</span><span class="icon i-3-s"></span></a>
PHP Code

<?php 
import bs4


soup 
= bs4.BeautifulSoup('<a href="Website">London, United Kingdom<span class="temp">68&deg;</span><span class="icon i-3-s"></span></a>',"html.parser")
print  (
soup.find_all("span", class_="temp" )[0].contents[0]) 
Please don't make double threads... https://hackforums.net/showthread.php?tid=5370621
(Aug 11, 2016 11:36 AM)SIM-1866423 Wrote:  
PHP Code

<?php 
import bs4


soup 
= bs4.BeautifulSoup('<a href="Website">London, United Kingdom<span class="temp">68&deg;</span><span class="icon i-3-s"></span></a>',"html.parser")
print  (
soup.find_all("span", class_="temp" )[0].contents[0]) 

Yeah that works but it wont using requests with the data being on the website
(Aug 11, 2016 02:32 PM)IGotTheKeys Wrote:  Yeah that works but it wont using requests with the data being on the website

Give us links and well give you code.
SRPP Discord Server

I am a professional network/cloud security architect.
My Old Tutorials
(Aug 11, 2016 08:52 PM)Goodies Wrote:  Give us links and well give you code.
Thanks but i solved it now


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C#] by ColdCypherDec 19, 2020 09:14 PM 0 140 Dec 19, 2020 09:14 PM
Last Post: ColdCypher
[.NET] by Johan CruyffJun 3, 2017 06:20 AM 8 427 Jun 3, 2017 06:20 AM
Last Post: Malicious Intent
[Python] by SkidyApr 13, 2017 03:16 AM 2 136 Apr 13, 2017 03:16 AM
Last Post: Skidy