xpathflipkart-api

Unable to write xpath for add to cart in flipkart


I am not able to write xpath for the following code.

I tried input[@value="Add to Cart" and data-seller-id="0275741dba3346b8"] but it doesn't work.

  <input class="btn-buy-now btn-big disabled current active" type="submit" value="Add to Cart" data-is-listing-buyable="true" data-is-pin-available="false" data-is-pin-serviceable="true" data-is-in-cart="true" data-is-large="false" data-disable-cart="true" data-vertical="carabiner" data-pid="CBRE7GW7PSCGX3VD" data-seller-id="0275741dba3346b8" data-listing-metrics="TO_BE_IMPLEMENTED" data-buy-listing-id="LSTCBRE7GW7PSCGX3VD2BFSP7"/>

Solution

  • You forgot an @ at data-seller-id in the XPath-Query-String

    input[@value="Add to Cart" and @data-seller-id="0275741dba3346b8"]
                                   ^