title: Scrapy - How to scrape a weblink within a weblink using python?
body: <p>I'm trying to scrape:</p>
  
  <p><a href="https://webmd.com/oral-health/oral-lichen-planus#1" rel="nofollow noreferrer">https://webmd.com/oral-health/oral-lichen-planus#1</a> from webmd website in the following web page code:</p>
  
  <pre><code>&lt;li class="global-nav-sign-in global-nav-hide-mobile" data-metrics-module=""&gt;
              &lt;a href="https://member.webmd.com/signin?appid=1&amp;amp;returl=https://www.webmd.com/oral-health/oral-lichen-planus#1" data-metrics-link="reg-login"&gt;Sign In&lt;/a&gt;
          &lt;/li&gt; 
  </code></pre>
  
  <p>I use the following scrapy code to achieve this:</p>
  
  <pre><code>import scrapy
  import re
  import string
  import pandas as pd
  
  class HealthItem(scrapy.Item):
      link = scrapy.Field()
  
  
  def urls_getter():
      fname = "/home/phil/fd/webmd/health.csv"
      pds = pd.read_csv(fname)
      pds_link = pds['link']
      pds_link = pds_link.drop_duplicates(keep = "first", inplace = False)
      pds_link = pds_link.tolist()
      return pds_link
  
  
  class SymptommdSpider(scrapy.Spider):
      name = "symptommd"
      allowed_domains = ["webmd.com"]
      start_urls = urls_getter()
      def parse(self, response):
          titles = response.xpath('//li[contains(@class, "global-nav-sign-in")]/a[contains(@href, "https:")]')
          for title in titles:
              item = HealthItem()
              item['link'] =  title.xpath('@href').extract()
              yield item
  </code></pre>
  
  <p>However, this code gets only the front portion of the a href.  Namely, <a href="https://member.webmd.com/signin" rel="nofollow noreferrer">https://member.webmd.com/signin</a>.  How do I get only the second web link?</p>