I'm using Julia, and right now I'm trying to use the PyCall package so that I can use the BeautifulSoup module for web parsing. My Julia code looks something like
using PyCall
pyinitialize("python3")
@pyimport bs4 #need BeautifulSoup
@pyimport urllib.request as urllib #need urlopen
url_base = "blah"
html = urllib.urlopen(url_base).read()
soup = bs4.BeautifulSoup(html, "lxml")
However, when I try to run it, I get complaints about the read() function. I first thought that read() would be a built-in Python function, but pybuiltin("read") didn't work.
I'm not sure what Python module I can import to get the read function. I tried importing the io module and using io.read(), but that didn't work. Additionally, using Julia's built-in read functions didn't work, since urllib.urlopen(url_base) is a PyObject.