question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support relative urls better

See original GitHub issue

Building 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:closed
  • Created 10 years ago
  • Reactions:2
  • Comments:38 (29 by maintainers)

github_iconTop GitHub Comments

1reaction
mc0ecommented, Sep 4, 2019

Found what I needed in @kmike’s comment above. Is there some reason to not consider that solution sufficient to close this issue?

0reactions
Gallaeciocommented, Sep 4, 2019

Fixed in #2540.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found