Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
spliting html code with br tag
#9
import requests
from bs4 import BeautifulSoup
 
url = 'https://www.ouedkniss.com/telephones'
response = requests.get(url)
soup = BeautifulSoup(response.content, 'lxml')
id_find = soup.find('div', id="ann-20047560")
text_tag = soup.find('span', class_="annonce_get_description", itemprop="description")
print(text_tag.text)
# split
print('-' * 20)
tag_spilt = text_tag.text.split('<br/>')
lst = tag_spilt[0].split('\r\n')
print(lst)
print('-'*20)
print(lst[0])
Quote:SmartphonesBluetooth Wifi 4G Produit neuf jamais utilisé Paiement à la livraisonCaractéristiques de la série 4 (gps)
boîtier en aluminium gris space gps intégré, glonass, galileo et qzss s4 avec processeur dual-core 64 bits w3 apple puce sans fil altimètre barométrique capacité 16 go 1 capteur cardiaque optique capteur cardiaque électrique accéléromètre amélioré
--------------------
['SmartphonesBluetooth Wifi 4G Produit neuf jamais utilisé Paiement à la livraisonCaractéristiques de la série 4 (gps)', 'boîtier en aluminium gris space gps intégré, glonass, galileo et qzss s4 avec processeur dual-core 64 bits w3 apple puce sans fil altimètre barométrique capacité 16 go 1 capteur cardiaque optique capteur cardiaque électrique accéléromètre amélioré ']
--------------------
SmartphonesBluetooth Wifi 4G Produit neuf jamais utilisé Paiement à la livraisonCaractéristiques de la série 4 (gps)


i will try more again, and see

if you see the picture we can split it from the <br>


[Image: IWEXCIR]


[Image: uHv0L8C]
Reply


Messages In This Thread
spliting html code with br tag - by yokaso - Aug-04-2019, 07:04 AM
RE: spliting html code with br tag - by snippsat - Aug-04-2019, 09:36 AM
RE: spliting html code with br tag - by yokaso - Aug-05-2019, 07:14 AM
RE: spliting html code with br tag - by snippsat - Aug-05-2019, 09:41 AM
RE: spliting html code with br tag - by yokaso - Aug-06-2019, 08:01 AM
RE: spliting html code with br tag - by snippsat - Aug-06-2019, 10:58 AM
RE: spliting html code with br tag - by yokaso - Aug-06-2019, 11:49 AM
RE: spliting html code with br tag - by snippsat - Aug-06-2019, 12:15 PM
RE: spliting html code with br tag - by yokaso - Aug-06-2019, 12:39 PM
RE: spliting html code with br tag - by snippsat - Aug-06-2019, 02:35 PM
RE: spliting html code with br tag - by yokaso - Aug-07-2019, 07:23 AM
RE: spliting html code with br tag - by snippsat - Aug-07-2019, 03:18 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Populating list items to html code and create individualized html code files ChainyDaisy 0 1,608 Sep-21-2022, 07:18 PM
Last Post: ChainyDaisy
  HTML multi select HTML listbox with Flask/Python rfeyer 0 4,700 Mar-14-2021, 12:23 PM
Last Post: rfeyer
  Python3 + BeautifulSoup4 + lxml (HTML -> CSV) - How to loop to next HTML/new CSV Row BrandonKastning 0 2,401 Mar-22-2020, 06:10 AM
Last Post: BrandonKastning
  How to get the href value of a specific word in the html code julio2000 2 3,245 Mar-05-2020, 07:50 PM
Last Post: julio2000
  Embedding HTML Code in Python kendias 5 4,327 Jan-27-2019, 01:43 AM
Last Post: kendias
  Help with Python and HTML code karlo_ds 4 3,485 Oct-16-2017, 03:03 PM
Last Post: karlo_ds

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020