-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript_checker.py
More file actions
30 lines (23 loc) · 1.16 KB
/
script_checker.py
File metadata and controls
30 lines (23 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import requests
from bs4 import BeautifulSoup
# List of websites to check
websites = ['https://jasonthechiu.com/lr-ats-examples/sso-examples', 'https://anaispirson.github.io', 'https://example.net', 'https://www.gumtree.com.au', 'https://www.news.com.au']
# Scripts you want to check for
scripts_to_check = ['https://ats.rlcdn.com/ats.js', 'https://ats-wrapper.privacymanager.io', 'https://launchpad-wrapper.privacymanager.io']
for website in websites:
try:
# Fetch the webpage
response = requests.get(website)
response.raise_for_status()
# Parse the HTML content
soup = BeautifulSoup(response.text, 'html.parser')
# Check if each script is present
script_tags = soup.find_all('script', src=True)
present_scripts = [script for script in scripts_to_check if any(script in tag['src'] for tag in script_tags)]
# Print results
if present_scripts:
print(f"The following scripts are present on {website}: {', '.join(present_scripts)}")
else:
print(f"None of the scripts are present on {website}")
except Exception as e:
print(f"Error checking {website}: {e}")