'How can I crawl the <body>details of the specific website using Julia in Mac?
I'm a beginner for programming and study on my own. Recently,I got stuck with coding.... I tried to crawl the table information for the following website,but it didn't work.... https://isin.twse.com.tw/isin/C_public.jsp?strMode=2
I'm studying Julia programming with Mac, so I just show my raw code
import Pkg; Pkg.add("Gumbo")
import Pkg; Pkg.add("HTTP")
import Pkg; Pkg.add("Cascadia")
using Gumbo, HTTP, Cascadia
headers=Dict("User-Agent"=>"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15")
url ="https://isin.twse.com.tw/isin/C_public.jsp?strMode=2"
html_data = HTTP.get(url,headers=headers)
h = parsehtml(String(html_data.body))
body = h.root[2]
body[2]
but,the output turned out to be...
BoundsError:attempt to access 0-element vector{HTMLnode} at index[2]
How can I fix it? I'm not a native and it's my first time to post! I hope it didn't bother all you kind guys. Many thanks :)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
