I am currently working on a web scraping project using Python, and I'm facing a challenge when it comes to extracting HTML data and formatting it for Excel. Here are the key details:
- I have successfully scraped a website using Python.
- Now, I want to extract the HTML data and format it into a structured form that can be easily read in Excel(i want it a data not a html to use it in my project).
I've tried using BeautifulSoup for HTML parsing and Pandas for creating a DataFrame, but I'm unsure about the best approach to format the data for Excel.
Could you please provide guidance or code examples on how to convert the scraped HTML data into a format suitable for Excel? Any advice on libraries or techniques for this specific task would be greatly appreciated.
import pandas as pd
from bs4 import BeautifulSoup
import requests
web = 'https://www.flashscore.com/match/Y79ZlOP1/#/match-
summary/match-summary'
response = requests.get(web)
content = response.text
soup = BeautifulSoup(content, 'lxml')
print(soup)
Thank you in advance!