If Job.JobName = "PageJob" Then
Dim mAutoName As Matcher = Regex.Matcher("<span itemprop='name'>""([^""]+)""</span>", Job.GetString)
Do While mAutoName.Find
namelinks.Add(mAutoName.Group(1))
Loop
BuildItems
End If
Result is only: []
Download and Job function works perfect with my ImageDownloader
Images URLs with this Code Working:
B4X:
Dim m As Matcher = Regex.Matcher("src=\""https://mywebsite/mmo([^""]+)""", Job.GetString)
If Job.JobName = "PageJob" Then
Dim xtemp As String
xtemp = Job.GetString
Log ("IndexOf: " & xtemp.IndexOf("<span itemprop='name'>"))
Dim m As Matcher = Regex.Matcher("<span itemprop='name'>(.*?)</span>", Job.GetString)
Do While m.Find
Log (m.Group(1))
namelinks.Add(m.Group(1))
Loop
BuildItems
End If
Log result with IndexOf: IndexOf: 112851
With IndexOf i can find the <span itemprop='name'> in the String. With Matcher not found.
Hi,
I tried the following on an on-line regex tool and it works, altough I don't think is an elegant solution; it simply works with data from post #1.
B4X:
<span itemprop='name'>\s*(.*)\s*<\/span>
In Group 1 you read Ferrari TestCar.
Fundamentally it matches any number of whitespaces after "'name'>", followed by the group containing the car model, followed again by any number of whitespaces chars, finally followed by </span>