You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The solution would be to simply have the retrieve method of the SemrushClient class handle a kwargs key of 'display_filter' directly on the api URL and let requests handle the remaining params.
There may be some other way to hook into urlencode, or the Requests library to skip encoding '|' characters, but I am not aware of any.
I realize this is a couple-year-old repo, so understood if not wanting to look at. I wanted to leave this here in case someone ran into the same issue.
The text was updated successfully, but these errors were encountered:
This repo, uses the requests library to hit the api URL and manage parameters. One issue with this is that when using display_filter, the api expects:
+|Ur|Co|electrical-supplies
(include|URL|Containing|electrical-supplies)
to be:
%2B|Ur|Co|electrical-supplies
if you pass this string to the client.domain_organic method, it will be converted to:
%252B%7CUr%7CCo%7Celectrical-supplies
when Requests builds the URL request.
a workaround is to do the following:
The solution would be to simply have the retrieve method of the SemrushClient class handle a kwargs key of 'display_filter' directly on the api URL and let requests handle the remaining params.
There may be some other way to hook into urlencode, or the Requests library to skip encoding '|' characters, but I am not aware of any.
I realize this is a couple-year-old repo, so understood if not wanting to look at. I wanted to leave this here in case someone ran into the same issue.
The text was updated successfully, but these errors were encountered: