This code is working as of the date of the post. It get the reply date from each of the python forum posts. Good luck.



import requests
from bs4 import BeautifulSoup


def trade_spider(max_pages): # function(maximum number of pages to call variable)
page = 1
while page <= max_pages:
url = "https://www.thenewboston.com/forum/category.php?id=15&orderby=recent&page=" + str(page) # url without page number
source_code = requests.get(url) # variable = requests.get(url)
html = source_code.text # get source code of page
soup = BeautifulSoup(html, 'html.parser') # variable to call beautifulsoup(variable of the source code)
for link in soup.findAll('a', {'class': 'post-title'}): # a = is the anchor in html and class is the css class beautiful soup will get only the data from this class
href = "https://www.thenewboston.com" + link.get('href') # website home page
title = link.string # get the title of the link
# print(title)
# print(href)
get_single_item_data(href)
page += 1


def get_single_item_data(item_url):
source_code = requests.get(item_url)
html = source_code.text
soup = BeautifulSoup(html, 'html.parser')
for item_name in soup.findAll('span', {'class': 'post-date'}):
print(item_name.string)

trade_spider(3)