Extracting link from <a href="javascript:void(0)" onClick="window.location.href='ourfoodold.php?pid=MTc='" >, JavaScript code

1,537 views
Skip to first unread message

Tapasweni Pathak

unread,
Jun 26, 2014, 6:19:31 AM6/26/14
to scrapy...@googlegroups.com
Hey, 

I am trying to parse a website using Scrappy. 

This is the website. I need to extract all the links from JavaScript code, <a href="javascript:void(0)" onClick="window.location.href='ourfoodold.php?pid=MTc='" >.

I tried this. But it's not working.

Here is my spider.

Can you please help me with this.


Thank you so much.

Lhassan Baazzi

unread,
Jun 26, 2014, 7:33:21 AM6/26/14
to scrapy...@googlegroups.com
Hi,

Please test the correctio I made on pastebin: http://pastebin.com/iuTbFGZh
Look at process_value function and the rules.


Regards.

Merci.
---------
Lhassan Baazzi | Web Developer PHP - Symfony - JS - Scrapy
Email/Gtalk: baazzi...@gmail.comSkype: baazzilhassan - Twitter: @baazzilhassan


--
You received this message because you are subscribed to the Google Groups "scrapy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scrapy-users...@googlegroups.com.
To post to this group, send email to scrapy...@googlegroups.com.
Visit this group at http://groups.google.com/group/scrapy-users.
For more options, visit https://groups.google.com/d/optout.

Tapasweni Pathak

unread,
Jun 27, 2014, 7:22:27 AM6/27/14
to scrapy...@googlegroups.com
Hey,

It worked. Thanks.
Can you please explain, what you have added in the restrict xpaths.


Thank you so much.
Reply all
Reply to author
Forward
0 new messages