How can I PULL some specific headlines from a website to excel file?

s2ci

Newbie
Joined
Nov 10, 2021
Messages
4
Reaction score
2
Hello guys newbie here,

So what I wanna do is create a script that can automatically pull texts from a website to an excel file.

For example if the website is bhw I wanna pull the first 2 sentences of the leading post in black hat SEO tools, automatically.

How can I write a script that pulls that comment automatically to an excel file, also I wanna edit aforementined referance intervals?

And I guess I gotta write a new script for every new website that I wanna or nah?

Any help is appriciated
 
You can use Python and a library called Beautiful Soup to extract specific information from a website and export it to an excel file.

Here's some sample code to get you started:

import requests
from bs4 import BeautifulSoup
import pandas as pd

url = 'https://www.blackhatworld.com/forums/black-hat-seo-tools.47/'
response = requests.get(url)
soup = BeautifulSoup(response.text, 'html.parser')

post = soup.find('li', class_='discussionListItem visible')
title = post.find('h3', class_='title').text.strip()
content = post.find('div', class_='messageText').text.strip()

df = pd.DataFrame({
'Title': [title],
'Content': [content]
})
df.to_excel('output.xlsx', index=False)


You can modify the code to extract different information from different websites. Cheers!
 
You can use Python and a library called Beautiful Soup to extract specific information from a website and export it to an excel file.

Here's some sample code to get you started:

import requests
from bs4 import BeautifulSoup
import pandas as pd

url = 'https://www.blackhatworld.com/forums/black-hat-seo-tools.47/'
response = requests.get(url)
soup = BeautifulSoup(response.text, 'html.parser')

post = soup.find('li', class_='discussionListItem visible')
title = post.find('h3', class_='title').text.strip()
content = post.find('div', class_='messageText').text.strip()

df = pd.DataFrame({
'Title': [title],
'Content': [content]
})
df.to_excel('output.xlsx', index=False)


You can modify the code to extract different information from different websites. Cheers!
Thanks G,

So I can use beautifulsoup to create a code that scrape information from websites.

Lets say that Im a noob (I really am lol) so how can I find a guy that can write such a code.

I want it to be automated, and wanna use it everyday.
 
U can use nodejs +puppeteer or cherio library to achieve that I can make it yorself with help of you tube or post here at hire a freelancer section to connect with anyone who can do that
 
Check the marketplace here for a coder. This should be an easy task.
 
Back
Top