E
E
Emil Revencu2016-09-01 11:49:59
Python
Emil Revencu, 2016-09-01 11:49:59

How to use Python in Classic ASP script?

I'm trying to make a parser on IIS (Classic ASP).
Why the code doesn't work

<script language="Python" runat="server">
import lxml.html
import requests
def gotourl(url):
  z=requests.get(url, timeout=(60,60))
  x=lxml.html.fromstring(z.text)
  return z.text
</script>
<%
url="http://www.google.com"
q=gotourl(url)
%>
<%=q%>

I get: HTTP/1.1 500 Server Error
The code crashes on the line "import lxml.html"

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sim3x, 2016-09-01
@sim3x

lxml is not part of the standard set of python libraries

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question