1

I have scraped some data from a website and when i try to pass this data to array i got this message:

LoadError: MethodError: Cannot `convert` an object of type HTMLText to an object of type Int64
carstenbauer
  • 9,817
  • 1
  • 27
  • 40
Anil Mathews
  • 151
  • 1
  • 3
  • Can you provide your code? Or even better, a distilled minimal version that produces the error? – carstenbauer Oct 19 '19 at 12:20
  • 3
    Wildly guessing, I'd say that you might need a `parse(Int64, obj)`, where `obj` is the `HTMLText` object, somewhere. – carstenbauer Oct 19 '19 at 12:21
  • LoadError: MethodError: no method matching parse(::Type{Int64}, ::HTMLText) Closest candidates are: parse(::Type{T}, !Matched::AbstractChar; base) where T<:Integer at parse.jl:41 parse(::Type{T}, !Matched::AbstractString; base) where T<:Integer at parse.jl:238 parse(::Type{T}, !Matched::AbstractString; kwargs...) where T<:Real at parse.jl:376 in expression starting at C:\Users\Office\.atom\packages\uber-juno\testing.jl:17 top-level scope at testing.jl:19 – Anil Mathews Oct 21 '19 at 04:35
  • using HTTP using Gumbo using Cascadia using DataFrames Base_Url="https://www.moneycontrol.com/india/stockpricequote/A" Active_Url=Base_Url println(Active_Url) h=HTTP.request("GET",Active_Url) html=parsehtml(String(h)) From_Website=eachmatch(sel".bl_12",html.root) #println(From_Website) #println(From_Website[5][1]) i=5 lst=[] while i>=1 company_Nam=From_Website[i][1] company_Name=parse(Int64,company_Nam) push!(company_Name,lst) end print(lst) – Anil Mathews Oct 21 '19 at 04:36
  • Actually, i need to scrape data from https://www.moneycontrol.com/india/stockpricequote/A and push to array then print – Anil Mathews Oct 21 '19 at 04:37

0 Answers0