|
I tried to use this:
url: '^http://browse\.deviantart\.com/',
nextLink: '//li[@class="next"]/a',
pageElement: '//div[@class="browse2-results"]',
for http://browse.deviantart.com/?order=5&offset=24 but it failed every time.
I checked the XPaths over and over but didn't find an error, so I came to the conclusion that the XPaths must be correct.
After searching a long time I found the problem:
deviantart.com uses (next) links like:
http://browse.deviantart.com?order=5&offset=48
Note that there is no / after the domain part.
This breaks isSameDomain(url), because the check
var url_s = url.split('/')
url_s[0] == location.protocol && location.host == url_s[2]
will end up as
http: == http: && browse.deviantart.com == browse.deviantart.com?order=5&offset=48
which will obviously fail.
In AutoPager.prototype.request it breaks
if (res.finalUrl && location.host == res.finalUrl.split('/')[2])
as well.
To fix this bug:
in isSameDomain(url):
- var url_s = url.split('/')
+ var url_s = url.split('?')[0].split('/')
in AutoPager.prototype.request:
- if (res.finalUrl && location.host == res.finalUrl.split('/')[2])
+ if (res.finalUrl && location.host == res.finalUrl.split('?')[0].split('/')[2])
|