Tool Open all games of a certain tag automatically

T10

Newbie
Sep 1, 2018
16
18
This python script opens all games under a tag link, just edit the tagURL and the maximum number of pages to open.

In the future I could open links based on number of reviews/star rating if this script gets enough interest.

Python:
import requests
from bs4 import BeautifulSoup
import webbrowser
import re
 
# SET THESE VARIABLES \/ #
#MAKE SURE YOU HAVE ENOUGH RAM!! :)
tagURL = 'https://f95zone.to/tags/horror/' #link to the tag name
numberOfPages = 22 #what is the maximum number of pages to open
openLinks = True
# SET THESE VARIABLES /\ #
chrome_path = 'C:/Program Files/Google/Chrome/Application/chrome.exe %s --incognito'
for i in range(1,numberOfPages+1) :
    reqs = requests.get(tagURL + "page-" + str(i))
    print("PAGE " + str(i))
    soup = BeautifulSoup(reqs.text, 'lxml')
    for h in soup.findAll('a'):
        l = re.findall('"([^"]*)"', str(h))[0]
        if l[0:9] == "/threads/":
            link = "https://f95zone.to" + l
            print(link)
            if openLinks:
                webbrowser. get(chrome_path).open_new_tab(link)
    print("PAGE " + str(i) + " COMPLETE")
    input("Press Enter to continue...")
 
Last edited: