MissingSchema: Invalid URL '/': No schema supplied. Perhaps you meant http:///?
<pre><code>for l in l1:
r = requests.get(l)
html = r.content
root = lxml.html.fromstring(html)   
urls = root.xpath('//div[@class="media-body"]//@href')
l2.extend(urls)
</code></pre>

<p>while running the above code this error coming. any solution??</p>

<p>MissingSchemaTraceback (most recent call last)</p>

<p>MissingSchema: Invalid URL '/': No schema supplied. Perhaps you meant <a href="http:///" rel="nofollow">http:///</a>?</p>

<pre><code>urls = root.xpath('//div[1]/header/div[3]/nav/ul/li/a/@href')
</code></pre>

<p>These HREFs aren't full URLs; they're essentially just pathnames (i.e. <code>/foo/bar/thing.html</code>).</p>

<p>When you click on one of these links in a browser, the browser is smart enough to prepend the current page's scheme and hostname (i.e. <code>https://host.something.com</code>) to these paths, making a full URL.</p>

<p>But your code isn't doing that; you're trying to use the raw HREF value.</p>

<p>Later on in your program you use <code>urljoin()</code> which solves this issue, but you aren't doing that in the <code>for l in l1:</code> loop.  <em>Why not?</em></p>

python