Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import scrapy
- from urllib.parse import urlencode
- def get_zenrows_api_url(url, api_key):
- # Define the necessary parameters
- payload = {
- 'url': url,
- 'js_render': 'true',
- 'js_instructions': '[{"wait": 500}]',
- 'premium_proxy': 'true',
- 'antibot': 'true',
- }
- # Construct the API URL
- api_url = f'https://api.zenrows.com/v1/?apikey={api_key}&{urlencode(payload)}'
- return api_url
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement