python url parsing 'function' object has no attribute 'urlparse'
<p>Trying to parse a url that I get with scrapy </p>

<pre><code>def parse_info_has_id(self, css_path):
    profileID = ""
    for div in css_path.xpath('div'):
        url = "".join(div.css('div &gt; a::attr(href)').extract())
        if "add_friend.php?id" in url:
            print(url)
            #parsed = urlparse.urlparse(url)
            #print urlparse.parse_qs(parsed.query)['id']

    return profileID
</code></pre>

<p>This prints </p>

<pre><code>/a/mobile/friends/add_friend.php?id=100003669247258&amp;hf=search&amp;sld=eyJzZWFyY2hfc2lkIjoiNGYxMmNhZGJhZDVkOGQ5ZGFkN2RkZTdhYjc3MTMwNTQiLCJxdWVyeSI6IjIwMjM2MDg3OTciLCJzZWFyY2hfdHlwZSI6IlNlYXJjaCIsInNlcXVlbmNlX2lkIjoxOTg2MTg0OTIzLCJwYWdlX251bWJlciI6MSwiZmlsdGVyX3R5cGUiOiJTZWFyY2giLCJlbnRfaWQiOjEwMDAwMzY2OTI0NzI1OCwicG9zaXRpb24iOjAsInJlc3VsdF90eXBlIjoyMDQ4fQ%3D%3D&amp;gfid=AQB03j5V7CqqGQSD/graphsearch/100003669247258/photos-of?ent=100003669247258&amp;refid=0&amp;query=2023608797&amp;sld=eyJzZWFyY2hfc2lkIjoiNGYxMmNhZGJhZDVkOGQ5ZGFkN2RkZTdhYjc3MTMwNTQiLCJxdWVyeSI6IjIwMjM2MDg3OTciLCJzZWFyY2hfdHlwZSI6IlNlYXJjaCIsInNlcXVlbmNlX2lkIjoxOTg2MTg0OTIzLCJwYWdlX251bWJlciI6MSwiZmlsdGVyX3R5cGUiOiJTZWFyY2giLCJlbnRfaWQiOjEwMDAwMzY2OTI0NzI1OCwicG9zaXRpb24iOjAsInJlc3VsdF90eXBlIjoyMDQ4fQ%3D%3D&amp;source=pivot
</code></pre>

<p>I want to get the id = <code>100003669247258</code> from the string but when I try</p>

<pre><code>#parsed = urlparse.urlparse(url)
#print urlparse.parse_qs(parsed.query)['id']
</code></pre>

<p>I get <code>'function' object has no attribute 'urlparse'</code> error, how can I parse that url string to get either id from <code>add_friend.php?id=10000366924725</code> or <code>/graphsearch/100003669247258/</code></p>