Best answer

Can't import urllib.request and bs4 BeautifulSoup into zapier

  • 15 March 2021
  • 2 replies
  • 758 views

I'm integrating zapier (to run python) to scrape latest reviews from www.tripadvisor.com at the https://www.tripadvisor.com/HotelsManagementCenter-g60982-d87016-c0-Hilton_Hawaiian_Village_Waikiki_Beach_Resort-Honolulu_Oahu_Hawaii.html

and populate to www.clickfunnel.com

Problem: For this job I tried importing urllib.request and bs4 BeautifulSoup but it seem no such modules installed with python.

The code is working perfect on my local system but on https://zapier.com/ throws the following error.

Error:

Traceback (most recent call last): File "", line 10, in the_function ModuleNotFoundError: No module named 'bs4'

Please suggest me a solution for this. Thanks in advance.

 

Please visit the link to code here

 

https://stackoverflow.com/q/66637592/4957925

icon

Best answer by GetUWired 17 March 2021, 16:03

View original

2 replies

Userlevel 7
Badge +12

@tech_pierce 

Zapier does not support installing modules in the code block as it is a sandbox environment. 

You would need to explore building this step in the CLI builder or using webhooks to run it on your local maching and push results back into Zapier. 

Userlevel 1

Came across this useful wrapper API for Python’s Beautiful Soup BS4.

You can pass your HTML to the API, and call the popular BS4 methods and request for any params.

This should do the trick

https://rapidapi.com/dollarbill99/api/beautifulsoup-wrapper 

Reply