Using scrapy, i want to fetch parameter of onclink function only, i am using response.css() to extract links.
If i am using regular expression for getting parameter only, got an error (AttributeError: 'list' object has no attribute 're')
<table class="table table-striped table-bordered table-hover Tax" >
<thead>
<tr>
<th>Sr No.</th>
<th>Name</th>
<th>Registration No</th>
<th>Address</th>
<th>Sectors</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td><td> <a href="javascript:void(0)" onclick='show_info("173543");'> ABCD</a></td>
<td>Address</td>
<td>12345</td>
<td>Data Not Found</td>
</tr></tbody></table>
I am using Scrapy for Scrap onclick parameter
link_first = response.css(".table.table-striped.table-bordered.table-hover.Tax>tbody>tr>td>a").xpath("./@onclick").extract().re("show_info\((.+?)\)", text)
Required O/P : 173543
.extract()[0].re("show_info\((.+?)\)"?.extract()andtextgot my response