mirror of
https://github.com/barkeser2002/trendyol-scrapper.git
synced 2026-09-25 02:30:01 +03:00
15 lines
402 B
Python
15 lines
402 B
Python
import re
|
|
|
|
with open('sample.html', encoding='utf-8') as f:
|
|
data = f.read()
|
|
|
|
scripts = re.findall(r'window\["(.*?)"\]=(.*?);\s*</script>', data, re.DOTALL)
|
|
print('Total matched scripts:', len(scripts))
|
|
for name, content in scripts:
|
|
if 'merchantListing' in content:
|
|
print('Found script name:', name)
|
|
print(content[:500])
|
|
break
|
|
else:
|
|
print('No merchantListing found')
|