Closed SalvadorSTM closed 3 years ago
What's the element it is pulling the ASIN from with this?
I mean, I know it's regex, but where in the html is that particular pattern located.
Right next to the oids.
New Regex String
asin\s?\"?\:?\s?\"?([A-Z0-9]+)\"?
Sample String
{"refTag":"aod_dpdsk_new_0","qty":1,"asin":"B0046O5YMA","oid":"9IIxPPIJjSkkuwixsTj9H2tdDshv%2Bqy4i5r8i3CgqUs1OMVW6i96aet9Hr9Mo2aB%2FBLYqVIbr0GVWZhAUnCTOr%2BetSqtu1ZsX5g8PwxveGNBQrpvjokaZDi8uomxkdzFHFyF0zmkPlIBlycqU10tCw48CyxTYFGn3xXGYxrpsHGY08hOeYhQWBamMttIjRbx","offerIndex":0}
Capturing Group 1
B0046O5YMA
Alright cool - I'll pull it in. Thanks!
Before, no asin existed in
tree.text_content()
, so the regex search will be performed onhtml.tostring(tree)
now which includes the entire html page. Modified the regex query for this purpose. A bit dirty but this will avoid future errors when amazon decides to update again as long as they maintain the pattern"asin":"asinvalue"
. Also updated the chromedriver version to the latest one available.