What is causing the error "MethodError: no method matching +(::UnitRange{Int64}, ::Int64)"

In the process of scraping some data from the web, the following code creates an error:

  idOpen = findall("""2">""",stringSnippetsI[i])[end]+1

The error produced is " MethodError: no method matching +(::UnitRange{Int64}, ::Int64)"

When inspecting what I am actually trying to define as idOpen I get


which is Int64, and more specifically



What is causing the problem? What am I missing?



doesn’t give an error, then

idOpen = <something>

also doesn’t give an error. So I think maybe the error is coming from somewhere else in your code, is that possible? Or you edited <something> between trying out both?

Maybe this helps you find it: the error indicates that you are trying to add a range (for example, 3:10) to an integer (for example, (3:10) + 42).

1 Like


You have that in the two examples that apparently work, but not in the original.