Skip to content

Commit

Permalink
fix search url
Browse files Browse the repository at this point in the history
  • Loading branch information
wenhwang97 committed Feb 9, 2025
1 parent f13a888 commit 8bd88f9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scraper/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ def get_target_url(country, keyword, startTime = "", page = 1):
path = "allSearch"
countryVar = f"?siteId={country}"
searchTypeVar = f"&keyWordType=all"
keyWordVar = f"&acSuggest={keyword}"
startTime = "" if not startTime else f"&startTime={startTime}"
keyWordVar = f"&includeAll={keyword}"
miscVar = "&random=&notInclude=&size=30&searchScope=is_all&hightSearchType=all&radio=publish_time_str"
startTime = f"&startTime={startTime}&endTime=2025-02-08"
pageVar = f"&page={page}"

url = "/".join([domain, path, countryVar + searchTypeVar + keyWordVar]) + startTime + pageVar
url = "/".join([domain, path, countryVar + searchTypeVar + keyWordVar + miscVar + startTime + pageVar])

return url

Expand Down

0 comments on commit 8bd88f9

Please sign in to comment.