I started playing with python and come across something that should be very simple but I cannot make it work... I had below HTML
<h2 class="sr-only">Available Products</h2>
<div id="productlistcontainer" data-defaultpageno="1" data-descfilter="" class="columns4 columnsmobile2" data-noproductstext="No Products Found" data-defaultsortorder="rank" data-fltrselectedcurrency="GBP" data-category="Category1" data-productidstodisableshortcutbuttons="976516" data-defaultpagelength="100" data-searchtermcategory="" data-noofitemsingtmpost="25">
<ul id="navlist" class="s-productscontainer2">
What I need is to use parser.xpath to get value of data-category element.
Im trying for example:
cgy = xpath('//div["data-category"]')
What Im doing wrong ?
<div>and<ul>tags aren't closed; don't know if that's relevant to anything, though