I am very much new to scrapy. I need to follow href from the homepage of a url to multiple depths. Again inside the href links i've multiple href's. I need to follow these href until i reach my desired page to scrape. The sample html of my page is:
Initial Page
<div class="page-categories">
<a class="menu" href="/abc.html">
<a class="menu" href="/def.html">
</div>
Inside abc.html
<div class="cell category" >
<div class="cell-text category">
<p class="t">
<a id="cat-24887" href="fgh.html"/>
</p>
</div>
I need to scrape the contents from this fgh.html page. Could anyone please suggest me where to start from. I read about Linkextractors but could not find a suitable reference to begin with. Thankyou
From what I see, I can say that:
.kat
id_
followed by a set of digitsLet's use this information to define our spider
rules
:In other words, we are asking spider to follow every category link and to let us know when it crawls a link containing
id_
- which would mean for us that we found a product - in this case, for the sake of an example, I'm printing the page title on the console. This should give you a good starting point.