-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathd_20250204_020455.txt
More file actions
33 lines (23 loc) · 983 Bytes
/
Copy pathd_20250204_020455.txt
File metadata and controls
33 lines (23 loc) · 983 Bytes
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
# Web Scraping Instructions
# Generated: 2025-02-04 02:04:55
# Fields to be extracted:
# - title
# - summary
# - author
# - publication_date
# Listing all fields to be extracted from the HTML.
# Fields to be extracted: # - title (from main heading) # - summary (from description) # - author (from author section) # - publication_date (from publication date)
# Loop through each URL in the specified text file.
FOR_EACH_URL IN urls.txt
# Wait for 5 seconds for the page to load completely.
WAIT 5
# Extract the main title from the heading and summary from the description.
EXTRACT {"title": "//h1[@class='main-heading']", "summary": "//div[@class='summary']"}
# Wait for 2 seconds to ensure all content is loaded.
WAIT 2
# Extract author information and publication date.
EXTRACT {"author": "//span[@class='author-name']", "publication_date": "//span[@class='pub-date']"}
# Save the extracted data to the JSON file.
SAVE_TO output.json
# End the URL iteration loop.
END_FOR