Skip to content

Commit

Permalink
feat: scrape output includes query
Browse files Browse the repository at this point in the history
  • Loading branch information
mjgiblett committed Sep 30, 2024
1 parent 866cb18 commit ddce6eb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion serps/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@

# other

DATAFRAME_COLUMNS = ["Page", "Position", "URL", "Title", "Description"]
DATAFRAME_COLUMNS = ["Query", "Page", "Position", "URL", "Title", "Description"]
QUERIES_FILETYPE = ".yaml"
3 changes: 2 additions & 1 deletion serps/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ def request_scrape(auth: tuple[str, str], payload: dict[str, Any]) -> DataFrame:
for result in data["content"]["results"]["organic"]:
results.append(
{
"Page": page,
"Query": query,
"Page": page + 1,
"Position": result["pos"],
"URL": result["url"],
"Title": result["title"],
Expand Down

0 comments on commit ddce6eb

Please sign in to comment.