-9

Is there anything wrong with the question I've asked in this link below:

I cannot located elements multiple classes using xpath python selenium

10
  • 3
    Two people already did. They cast close votes. One person even went so far as to leave you a comment. What part are you confused about?
    – Cody Gray Mod
    Commented Jul 20, 2020 at 6:36
  • well, I did re-edit it my question. which is why am i asking it Commented Jul 20, 2020 at 6:40
  • 6
    You don't mention why you think anything is wrong with your code. Errors (give the traceback)? Unexpected outputs (compared the expected and actual outputs)?
    – jonrsharpe
    Commented Jul 20, 2020 at 6:42
  • @jonrsharpe that is the thing it doesn't produce errors. Commented Jul 20, 2020 at 6:45
  • 8
    “I don’t know what is wrong with this code” may be an indicator that you didn’t spend enough time researching your issue. Have you tried different things in your code? Have you read the documentation? See How much research effort is expected of Stack Overflow users?. Also, see Why is “Can someone help me?” not an actual question?. Commented Jul 20, 2020 at 6:46
  • But you've presumably seen something that makes you think it isn't working, otherwise you wouldn't be asking about it. So tell us what that was.
    – jonrsharpe
    Commented Jul 20, 2020 at 7:23
  • @jonrsharpe The Xpath supposes to locate the parent div class "col-xs-2-4 shopee-search-item-result__item" and one href "/Direct-Export-Super-Single-Mattress-Synthetic-Latex-(6-Inches)-i.281593956.6140904430" which is works perfectly till when i try to locate 2 more elements child div class "_1HvBLA" and div class "_3ao649". Commented Jul 20, 2020 at 7:30
  • 3
    And what happens then? Don't tell me, edit it into your question.
    – jonrsharpe
    Commented Jul 20, 2020 at 7:31
  • @jonrsharpe hmmm ok i think it i've edit it quite well already Commented Jul 20, 2020 at 7:35
  • Not bellow. Commented Jul 20, 2020 at 8:51

1 Answer 1

19

Remember we're all volunteers, our time is valuable, we're extremely lazy.

Here are my tips:

  • Separate the Xpath from the code to make it instant visible. Now I have to scroll to the right to see your XPATH.
  • Explain what you think that XPATH does
  • If I want to test your code, why do I have to type all that HTML myself based on your screenshot.
  • Take smaller steps and debug those.
    • Could you reach / find the correct node with the first part of the XPATH?
    • What happened when you added the next part?
    • Nail down your actual problem and describe that for us.
  • You did verify that code (in the first revision) actually runs? (as in: If I copy that code in an IDE and add the needed imports myself it will run. That is what is meant with minimal reproducible example)
  • It works with any Python / Selenium version?
  • It behaves the same on all browsers?
  • Those css classes look suspicious. Are you sure those stay the same each time the page is loaded? Because then your code might be fine, just not suited for this particular html.
  • We know you're thankful, you can remove the Thank you at the end of your question. See Should 'Hi', 'thanks', taglines, and salutations be removed from posts?
3
  • It works but just doesn't click on the link and I've re-edited it. please do kindly check it. Commented Jul 20, 2020 at 7:07
  • 5
    @Francabiconfranc by adding all your code you made it worse. And you didn't address all my points with that edit. (Okay, you removed the Thank You, so that is done then).
    – rene
    Commented Jul 20, 2020 at 7:24
  • ive done already is it ok for it? Commented Jul 20, 2020 at 7:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .