cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Execute python using Script/Execute script snap

Siva_Venna
Contributor

I have below python code to pass script output to file reader snap. As script needs some libraries,are they supported by snaplogic? Please suggest how to execute this script.
Code:

#Import libraries

import requests
from bs4 import BeautifulSoup
import re

# Set the URL to webscrape from

url = โ€˜https://www.cms.gov/Medicare-Medicaid-Coordination/Medicare-and-Medicaid-Coordination/Medicare-Medic...โ€™
response = requests.get(url)
soup = BeautifulSoup(response.text, โ€œhtml.parserโ€)
all_links=soup.findAll(โ€˜aโ€™)
link=soup.find(โ€˜aโ€™, title=re.compile(โ€˜MMEnrolleeStateandCountyEnrollmentSnapshotsQuarterlyโ€™))
file_name = (link[โ€˜hrefโ€™])

4 REPLIES 4

Siva_Venna
Contributor

Can someone shed some some light on this query? Thanks.

ashlam
New Contributor

Hi,Have you got solution for thisโ€ฆ?

Siva_Venna
Contributor

I have implemented this by hard coding the link in the snap. excluded this python script

Thank you for the quick reply.I appreciate it.