0

I am trying to parse the date element ("3 February 2022") on the following webpage. However, I am unable to find it, even when using selenium to load it. Any suggestions to what I am doing wrong? Currently trying with the following code:

import requests as re
from bs4 import BeautifulSoup
import time
import re
from selenium import webdriver    

url = "http://www.londonstockexchange.com/news-article/SAIN/net-asset-value-s/15316710"
driver = webdriver.Chrome()
    
driver.get(url)
time.sleep(5)
soup = str(BeautifulSoup(driver.page_source, 'html.parser'))
date = re.findall("[0-9]{1,2}\s[A-Z][a-z]+\s[0-9]{4}", soup)
print(f'Tager {date[-1]} ud af mulige datoer: {date}')
baduker
  • 19,152
  • 9
  • 33
  • 56
Sjamsing
  • 57
  • 4
  • 1
    Does this answer your question? [How to decode Angular's custom HTML encoding with Python](https://stackoverflow.com/questions/67038324/how-to-decode-angulars-custom-html-encoding-with-python) – baduker Mar 09 '22 at 09:47
  • The London Stock Exchange website is custom-encoded, so it's not so straight forward to scrape it with plain bs4. – baduker Mar 09 '22 at 09:48

0 Answers0