-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathverify_fix.py
More file actions
40 lines (32 loc) · 1.25 KB
/
Copy pathverify_fix.py
File metadata and controls
40 lines (32 loc) · 1.25 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
31
32
33
34
35
36
37
38
39
40
import sys
import logging
from backend.auth_service import AuthService
from backend.scrapers.classlink_scraper import scrape_classlink
import json
logging.basicConfig(level=logging.INFO)
def verify_fix():
print("Testing extraction for ClassLink article...")
url = "https://help.classlink.com/s/article/apptrack-admin-release-notes"
auth = AuthService()
try:
# Use headless false to see if login is working, or let it use the existing saved profile
driver = auth.get_driver(headless=False)
articles, markdown = scrape_classlink(url, "AppTrack", driver)
if not articles:
print("Failed to scrape article.")
return
article = articles[0]
print("\n--- EXTRACTION RESULTS ---")
print(f"Product: {article.get('product')}")
print(f"Audience: {article.get('audience')}")
print(f"Article Name: {article.get('article_name')}")
print("\nExpected:")
print("Product: AppTrack")
print("Audience: ClassLink Administrator")
print("Article Name: AppTrack Admin Release Notes")
except Exception as e:
print(f"Error during verification: {e}")
finally:
auth.close()
if __name__ == "__main__":
verify_fix()