Closed netzstreuner closed 6 years ago
Hmm not sure if this is an API or this R implementation issue, but the error suggests the pageURL isn't present in your list to fix. You may want to set options(googleAuthR.verbose = 2)
and do the call again and inspect what is sent to see if that gives any clues. You could also try encoding the whole URL, using URLencode("de/theurltoencode/")
Hi Mark, thanks for your quick reply.
I set options(googleAuthR.verbose = 2)
and it turns out that the URL is incorrectly encoded.
Incorrectly encoded URL with umlauts (the slashes are not encoded):
https://www.googleapis.com/webmasters/v3/sites/http%3A%2F%2Fwww.XXXXX%2F/urlCrawlErrorsSamples/de/k%C3%B6ln/koeln-dom/?category=notFound&platform=web
Correctly encoded URL without umlauts:
https://www.googleapis.com/webmasters/v3/sites/http%3A%2F%2Fwww.XXXXX%2F/urlCrawlErrorsSamples/hu%2Fma%2F?category=notFound&platform=web
After using urltools::url_encode
the URL is correctly encoded and can be marked as fixed:
> fix_sample_url(siteURL = "http://www.XXXXX/",
+ category = "notFound",
+ pageURL = url_encode("de/k%C3%B6ln/koeln-dom/"),
+ platform = "web")
2018-01-16 09:38:57> Token exists.
2018-01-16 09:38:57> Request: https://www.googleapis.com/webmasters/v3/sites/http%3A%2F%2Fwww.XXXXX%2F/urlCrawlErrorsSamples/de%2fk%25C3%25B6ln%2fkoeln-dom%2f?category=notFound&platform=web
[1] TRUE
Thanks again for your help!
Great, glad it helped.
Hi,
I have the following URL/path I'd like to mark as fixed
de/k%C3%B6ln/koeln-dom/
.I get the following error message:
fix_sample_url
works just fine with every other URL, that has no URL encoded Umlauts.Am I doing something wrong?
Cheers,
Patrick