ret=requests.get(url) html = pq(ret) script_tags=html.find('script') target_variable='window.__INITIAL_DATA__' for script_tag in script_tags.items(): match = re.search(f'{target_variable}\s*=\s*(.*?);', script_tag.text()) if match: variable_value = match.group(1) print(variable_value)
03-31
7068