Support relative urls better
See original GitHub issueBuilding an URL relative to current URL is a very common task; currently users are required to do that themselves - import urlparse
and then urlparse.urljoin(response.url, href)
.
What do you think about adding a shortcut for that - something like response.urljoin(href)
or response.absolute_url(href)
?
Another crazy idea is to support relative urls directly, by assuming they are relative to a response.url
. I think it can be implemented as a spider middleware. I actually like this idea 😃
Issue Analytics
- State:
- Created 10 years ago
- Reactions:2
- Comments:38 (29 by maintainers)
Top Results From Across the Web
How Absolute URLs vs Relative URLs work - Knowledge Center
The benefit of using Relative URLs is if your domain changes you don't have to manually update all of your site links. For...
Read more >ABSOLUTE OR RELATIVE URLS? - seo-nerd | Dec. 2022
When using absolute URLs, the link always points to the correct URL. The content is thus better protected against theft. If someone simply...
Read more >Absolute Links vs. Relative Links: Which Is Better for SEO?
Some say absolute links work best for them, while others agree that relative links are their go-to option. Want to know what we...
Read more >Absolute URLs – Better Safe Than Sorry? - SEO.com
Relative URLs carry the same effectiveness as absolute URLs, and vice-versa. There is no difference regarding their impact with SEO. However, the general ......
Read more >Relative vs Absolute URLs: How to Avoid Diluting Site Authority
Absolute URLs contain all of the data pertaining to a URL, including information about the protocol or domain. · Relative URLs do not...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Found what I needed in @kmike’s comment above. Is there some reason to not consider that solution sufficient to close this issue?
Fixed in #2540.