title: How to add "https://www." into your scraping result with python?
body: <p>I am trying to scrape a few URLs via python. In particular, I am working on the link to <a href="https://www.elections.gov.hk/dc2019/eng/intro_to_can/A.html" rel="nofollow noreferrer">the Hong Kong electoral platforms.</a> I used the inspect function that chrome provides, and I also used the etree function of lxml on python. I have located the XPath of the text.</p>
  <p>The code that I have used is</p>
  <pre><code>def extract_info_urls(self, response):
          raw_tree = etree.HTML(response)
          platform_urls = raw_tree.xpath('//*[@id=&quot;table-district-member&quot;]/tbody/tr/td[6]/div/a/@href|//*[@id=&quot;table-district-member&quot;]/tbody/tr/td[4]/div/a/@href')
          return [&quot;https://www.elections.gov.hk/dc2019/&quot; + platform_url.lstrip(&quot;../..&quot;) for platform_url in platform_urls]
  </code></pre>
  <p>The results look something like this:</p>
  <pre><code>../../pdf/intro_to_can/A01_1_ENG.html
  ../../pdf/intro_to_can/A01_2_ENG.html
  ../../pdf/intro_to_can/A02_1_ENG.html
  
  ...
  </code></pre>
  <p>With the above being said, my humble question is how can I obtain the full URLs - e.g (<a href="https://www.elections.gov.hk/dc2019/pdf/intro_to_can/A01_1_ENG.html" rel="nofollow noreferrer">https://www.elections.gov.hk/dc2019/pdf/intro_to_can/A01_1_ENG.html</a>)
  instead of just URL starting with &quot;../../pdf&quot; in the results.</p>
  <p>I appreciate all your help. Looking forward to learning from you all here!</p>
  <p>Thank you very much.</p>