-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathscrape_step_6_generate.py
More file actions
28 lines (21 loc) · 960 Bytes
/
scrape_step_6_generate.py
File metadata and controls
28 lines (21 loc) · 960 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
import datetime
import openpyxl
def main(place_name, search_term):
timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
# Define file paths
input_file_path = f"{place_name}_{search_term}_{timestamp}_input.xlsx"
output_file_path = f"{place_name}_{search_term}_{timestamp}_output.xlsx"
insta_file_path = f"{place_name}_{search_term}_{timestamp}_insta.xlsx"
# Create Excel files and write "By Vergil1000" to the first cell
for file_path in [input_file_path, output_file_path, insta_file_path]:
workbook = openpyxl.Workbook()
worksheet = workbook.active
worksheet.cell(row=1, column=1, value="By Vergil1000")
workbook.save(file_path)
return input_file_path, output_file_path, insta_file_path
if __name__ == "__main__":
# Example usage
place_name = "Varanasi"
search_term = "Aesthetics Clinic"
files = main(place_name, search_term)
print("Generated files:", files)