简体   繁体   中英

Python Selenium Send Amazon Seller Product Customization Message

I am at a sticking point with an Amazon bot I have been writing.. I have read many articles on the potential problem, and I have also tried testing various combinations of workarounds, which have unfortunately not fixed the problem.

The task that I am trying to accomplish is the sending of a post-purchase order customization message to an Amazon seller. The programming workflow is as follows:

  1. Click "problem with order"
  2. Click "other issue"
  3. Click "Contact seller"
  4. Click "Select Reason" dropdown menu
  5. Click "Product customization" dropdown option
  6. Click "Describe your issue" textarea <-- PROBLEM HERE
  7. Click "Send" button

Those familiar with this section of the Amazon website will know exactly what I am referring to.

The problem occurs with the textarea which does not validate upon clicking the send button, however upon inspecting a screenshot the text is visible within the textarea. I am going to supply the DOM of the textarea to see if that helps anyone provide insight into what may be happening here:

<div id="CONTACT_SELLER_OTHER_form" class="a-row">
            
            <div class="a-section">
                <div class="a-row">
                    <p class="a-spacing-small">
                        <span id="CONTACT_SELLER_OTHER_prompt">Contact the seller and allow the seller two days to get back to you</span>
                    </p>

                    

                    
                    

                    <span class="a-declarative" data-action="text-changed" data-csa-c-type="widget" data-csa-c-func-deps="aui-da-text-changed" data-text-changed="{&quot;inputPrefix&quot;:&quot;CONTACT_SELLER_OTHER&quot;}" data-csa-c-id="fetpfe-xkh75w-hthgz8-ywllw">
                        <div class="a-input-text-wrapper"><textarea maxlength="4000" placeholder="Describe your issue" id="CONTACT_SELLER_OTHER_changeBody" rows="4" name="changeText" spellcheck="true"></textarea></div>
                    </span>
                    <div class="a-column a-span12 a-text-right a-spacing-medium">
                        <span id="CONTACT_SELLER_OTHER_remChars" class="a-size-small a-color-tertiary">
                            4000
                        </span>
                        <span class="a-size-small a-color-tertiary">
                            characters remaining
                        </span>
                    </div>

                    
                    
                    
                    

                    <div class="a-row">
                        <span class="a-declarative" data-action="clickable-action-declarative" data-csa-c-type="widget" data-csa-c-func-deps="aui-da-clickable-action-declarative" data-clickable-action-declarative="{}" data-csa-c-id="8mu792-691pf8-tyadjf-wkj88p">
                            <span class="a-declarative" data-action="submit-problem" data-csa-c-type="widget" data-csa-c-func-deps="aui-da-submit-problem" data-submit-problem="{&quot;reason&quot;:&quot;OTHER&quot;,&quot;problem&quot;:&quot;{\&quot;id\&quot;:\&quot;amzn1.pwo.v1.2021362jn4mw8uqqzgnaethmlm8ow\&quot;,\&quot;version\&quot;:\&quot;1\&quot;,\&quot;amount\&quot;:33.95,\&quot;baseCurrency\&quot;:\&quot;USD\&quot;,\&quot;orderId\&quot;:\&quot;112-9877121-7313815\&quot;,\&quot;countryCode\&quot;:\&quot;US\&quot;,\&quot;submittedTime\&quot;:\&quot;2021-12-28T06:21:15.238Z\&quot;,\&quot;comments\&quot;:\&quot;Please cancel this order. Thanks!\&quot;,\&quot;submitter\&quot;:{\&quot;role\&quot;:\&quot;Claimant\&quot;,\&quot;login\&quot;:\&quot;unknown\&quot;,\&quot;customerId\&quot;:\&quot;A152MSST3GCKQF\&quot;},\&quot;marketplaceId\&quot;:\&quot;ATVPDKIKX0DER\&quot;,\&quot;claimantId\&quot;:\&quot;A152MSST3GCKQF\&quot;,\&quot;respondentId\&quot;:\&quot;A1DI45MUWFG9A6\&quot;,\&quot;onscreenResolution\&quot;:false,\&quot;claimRequesterId\&quot;:\&quot;A23ZP02F085DFQ\&quot;,\&quot;avenue\&quot;:{\&quot;avenueCode\&quot;:\&quot;CONTACT_SELLER\&quot;,\&quot;displayName\&quot;:\&quot;Contact seller\&quot;,\&quot;displaySubText\&quot;:\&quot;\&quot;,\&quot;actionText\&quot;:\&quot;Contact seller\&quot;,\&quot;postSubmissionConfirmationText\&quot;:\&quot;Message sent\&quot;,\&quot;postSubmissionConfirmationSubText\&quot;:\&quot;If the seller does not resolve your issue within 48 hours of the first message, you can revisit this page to check if you are eligible to request an A-to-z Guarantee refund.\&quot;},\&quot;reason\&quot;:{\&quot;reasonCode\&quot;:\&quot;OTHER\&quot;,\&quot;detailCode\&quot;:\&quot;CANCEL_ORDER\&quot;,\&quot;displayString\&quot;:\&quot;Other issue\&quot;,\&quot;displayDetailText\&quot;:\&quot;Request cancellation\&quot;},\&quot;csaState\&quot;:{},\&quot;claimantState\&quot;:{\&quot;status\&quot;:\&quot;Pending\&quot;},\&quot;respondentState\&quot;:{},\&quot;investigationState\&quot;:{},\&quot;changeOptions\&quot;:[{\&quot;actor\&quot;:{\&quot;role\&quot;:\&quot;Claimant\&quot;,\&quot;login\&quot;:\&quot;unknown\&quot;,\&quot;customerId\&quot;:\&quot;A152MSST3GCKQF\&quot;},\&quot;changeDate\&quot;:\&quot;2021-12-28T06:21:15.238Z\&quot;,\&quot;reason\&quot;:\&quot;PROVIDE_INFORMATION\&quot;,\&quot;description\&quot;:\&quot;Claimant changing state to 'ProblemState(csaState=Pending, claimantState=Pending, respondentState=Pending, investigationState=ActionRequired, legacyStatus=INVG)' via HealBeam; reason=PROVIDE_INFORMATION\&quot;,\&quot;csaState\&quot;:{\&quot;status\&quot;:\&quot;Pending\&quot;},\&quot;claimantState\&quot;:{\&quot;status\&quot;:\&quot;Pending\&quot;},\&quot;respondentState\&quot;:{\&quot;status\&quot;:\&quot;Pending\&quot;},\&quot;investigationState\&quot;:{\&quot;status\&quot;:\&quot;ActionRequired\&quot;},\&quot;commentsRequired\&quot;:true,\&quot;legacyStatus\&quot;:\&quot;INVG\&quot;,\&quot;claimOpsOverride\&quot;:false},{\&quot;actor\&quot;:{\&quot;role\&quot;:\&quot;Claimant\&quot;,\&quot;login\&quot;:\&quot;unknown\&quot;,\&quot;customerId\&quot;:\&quot;A152MSST3GCKQF\&quot;},\&quot;changeDate\&quot;:\&quot;2021-12-28T06:21:15.238Z\&quot;,\&quot;reason\&quot;:\&quot;CANCEL_PROBLEM\&quot;,\&quot;description\&quot;:\&quot;Claimant changing state to 'ProblemState(csaState=Resolved, claimantState=Resolved, respondentState=Resolved, investigationState=ActionRequired, legacyStatus=BWDQ)' via HealBeam; reason=CANCEL_PROBLEM\&quot;,\&quot;csaState\&quot;:{\&quot;status\&quot;:\&quot;Resolved\&quot;},\&quot;claimantState\&quot;:{\&quot;status\&quot;:\&quot;Resolved\&quot;},\&quot;respondentState\&quot;:{\&quot;status\&quot;:\&quot;Resolved\&quot;},\&quot;investigationState\&quot;:{\&quot;status\&quot;:\&quot;ActionRequired\&quot;},\&quot;commentsRequired\&quot;:true,\&quot;legacyStatus\&quot;:\&quot;BWDQ\&quot;,\&quot;claimOpsOverride\&quot;:false},{\&quot;actor\&quot;:{\&quot;role\&quot;:\&quot;Respondent\&quot;,\&quot;login\&quot;:\&quot;unknown\&quot;,\&quot;customerId\&quot;:\&quot;A1DI45MUWFG9A6\&quot;},\&quot;changeDate\&quot;:\&quot;2021-12-28T06:21:15.238Z\&quot;,\&quot;reason\&quot;:\&quot;PROVIDE_INFORMATION\&quot;,\&quot;description\&quot;:\&quot;Respondent changing state to 'ProblemState(csaState=Pending, claimantState=Pending, respondentState=Pending, investigationState=ActionRequired, legacyStatus=INVG)' via HealBeam; reason=PROVIDE_INFORMATION\&quot;,\&quot;csaState\&quot;:{\&quot;status\&quot;:\&quot;Pending\&quot;},\&quot;claimantState\&quot;:{\&quot;status\&quot;:\&quot;Pending\&quot;},\&quot;respondentState\&quot;:{\&quot;status\&quot;:\&quot;Pending\&quot;},\&quot;investigationState\&quot;:{\&quot;status\&quot;:\&quot;ActionRequired\&quot;},\&quot;commentsRequired\&quot;:true,\&quot;legacyStatus\&quot;:\&quot;INVG\&quot;,\&quot;claimOpsOverride\&quot;:false},{\&quot;actor\&quot;:{\&quot;role\&quot;:\&quot;ClaimsOps\&quot;,\&quot;login\&quot;:\&quot;unknown\&quot;},\&quot;changeDate\&quot;:\&quot;2021-12-28T06:21:15.238Z\&quot;,\&quot;reason\&quot;:\&quot;GRANT\&quot;,\&quot;csaState\&quot;:{\&quot;status\&quot;:\&quot;Resolved\&quot;},\&quot;claimantState\&quot;:{\&quot;status\&quot;:\&quot;Resolved\&quot;},\&quot;respondentState\&quot;:{\&quot;status\&quot;:\&quot;Resolved\&quot;},\&quot;investigationState\&quot;:{\&quot;status\&quot;:\&quot;Resolved\&quot;},\&quot;commentsRequired\&quot;:false,\&quot;legacyStatus\&quot;:\&quot;GRNT\&quot;,\&quot;claimOpsOverride\&quot;:false},{\&quot;actor\&quot;:{\&quot;role\&quot;:\&quot;ClaimsOps\&quot;,\&quot;login\&quot;:\&quot;unknown\&quot;},\&quot;changeDate\&quot;:\&quot;2021-12-28T06:21:15.238Z\&quot;,\&quot;reason\&quot;:\&quot;CANCEL_PROBLEM\&quot;,\&quot;csaState\&quot;:{\&quot;status\&quot;:\&quot;Resolved\&quot;},\&quot;claimantState\&quot;:{\&quot;status\&quot;:\&quot;Resolved\&quot;},\&quot;respondentState\&quot;:{\&quot;status\&quot;:\&quot;Resolved\&quot;},\&quot;investigationState\&quot;:{\&quot;status\&quot;:\&quot;Resolved\&quot;},\&quot;commentsRequired\&quot;:true,\&quot;legacyStatus\&quot;:\&quot;BWDR\&quot;,\&quot;claimOpsOverride\&quot;:false},{\&quot;actor\&quot;:{\&quot;role\&quot;:\&quot;ClaimsOps\&quot;,\&quot;login\&quot;:\&quot;unknown\&quot;},\&quot;changeDate\&quot;:\&quot;2021-12-28T06:21:15.238Z\&quot;,\&quot;reason\&quot;:\&quot;NO_GRANT\&quot;,\&quot;csaState\&quot;:{\&quot;status\&quot;:\&quot;Resolved\&quot;},\&quot;claimantState\&quot;:{\&quot;status\&quot;:\&quot;Resolved\&quot;},\&quot;respondentState\&quot;:{\&quot;status\&quot;:\&quot;Resolved\&quot;},\&quot;investigationState\&quot;:{\&quot;status\&quot;:\&quot;Resolved\&quot;},\&quot;commentsRequired\&quot;:false,\&quot;legacyStatus\&quot;:\&quot;NOGR\&quot;,\&quot;claimOpsOverride\&quot;:false},{\&quot;actor\&quot;:{\&quot;role\&quot;:\&quot;ClaimsOps\&quot;,\&quot;login\&quot;:\&quot;unknown\&quot;},\&quot;changeDate\&quot;:\&quot;2021-12-28T06:21:15.238Z\&quot;,\&quot;reason\&quot;:\&quot;REQUEST_INFO_CLAIMANT\&quot;,\&quot;csaState\&quot;:{\&quot;status\&quot;:\&quot;ActionRequired\&quot;},\&quot;claimantState\&quot;:{\&quot;status\&quot;:\&quot;ActionRequired\&quot;},\&quot;respondentState\&quot;:{\&quot;status\&quot;:\&quot;Pending\&quot;},\&quot;investigationState\&quot;:{\&quot;status\&quot;:\&quot;Pending\&quot;},\&quot;commentsRequired\&quot;:false,\&quot;legacyStatus\&quot;:\&quot;RABI\&quot;,\&quot;claimOpsOverride\&quot;:false},{\&quot;actor\&quot;:{\&quot;role\&quot;:\&quot;ClaimsOps\&quot;,\&quot;login\&quot;:\&quot;unknown\&quot;},\&quot;changeDate\&quot;:\&quot;2021-12-28T06:21:15.238Z\&quot;,\&quot;reason\&quot;:\&quot;REQUEST_INFO_RESPONDENT\&quot;,\&quot;csaState\&quot;:{\&quot;status\&quot;:\&quot;Pending\&quot;},\&quot;claimantState\&quot;:{\&quot;status\&quot;:\&quot;Pending\&quot;},\&quot;respondentState\&quot;:{\&quot;status\&quot;:\&quot;ActionRequired\&quot;},\&quot;investigationState\&quot;:{\&quot;status\&quot;:\&quot;Pending\&quot;},\&quot;commentsRequired\&quot;:false,\&quot;legacyStatus\&quot;:\&quot;RASI\&quot;,\&quot;claimOpsOverride\&quot;:false},{\&quot;actor\&quot;:{\&quot;role\&quot;:\&quot;ClaimsOps\&quot;,\&quot;login\&quot;:\&quot;unknown\&quot;},\&quot;changeDate\&quot;:\&quot;2021-12-28T06:21:15.238Z\&quot;,\&quot;reason\&quot;:\&quot;RESPONDENT_ISSUED_REFUND\&quot;,\&quot;csaState\&quot;:{\&quot;status\&quot;:\&quot;Resolved\&quot;},\&quot;claimantState\&quot;:{\&quot;status\&quot;:\&quot;Resolved\&quot;},\&quot;respondentState\&quot;:{\&quot;status\&quot;:\&quot;Resolved\&quot;},\&quot;investigationState\&quot;:{\&quot;status\&quot;:\&quot;Resolved\&quot;},\&quot;commentsRequired\&quot;:false,\&quot;legacyStatus\&quot;:\&quot;SRFD\&quot;,\&quot;claimOpsOverride\&quot;:false},{\&quot;actor\&quot;:{\&quot;role\&quot;:\&quot;ClaimsOps\&quot;,\&quot;login\&quot;:\&quot;unknown\&quot;},\&quot;changeDate\&quot;:\&quot;2021-12-28T06:21:15.238Z\&quot;,\&quot;reason\&quot;:\&quot;SNOOZE\&quot;,\&quot;csaState\&quot;:{\&quot;status\&quot;:\&quot;Pending\&quot;},\&quot;claimantState\&quot;:{\&quot;status\&quot;:\&quot;Pending\&quot;},\&quot;respondentState\&quot;:{\&quot;status\&quot;:\&quot;Pending\&quot;},\&quot;investigationState\&quot;:{\&quot;status\&quot;:\&quot;Pending\&quot;},\&quot;commentsRequired\&quot;:false,\&quot;legacyStatus\&quot;:\&quot;HOLD\&quot;,\&quot;claimOpsOverride\&quot;:false},{\&quot;actor\&quot;:{\&quot;role\&quot;:\&quot;CSA\&quot;,\&quot;login\&quot;:\&quot;unknown\&quot;,\&quot;customerId\&quot;:\&quot;A152MSST3GCKQF\&quot;},\&quot;changeDate\&quot;:\&quot;2021-12-28T06:21:15.238Z\&quot;,\&quot;reason\&quot;:\&quot;PROVIDE_INFORMATION\&quot;,\&quot;description\&quot;:\&quot;CSA changing state to 'ProblemState(csaState=Pending, claimantState=Pending, respondentState=Pending, investigationState=ActionRequired, legacyStatus=INVG)' via HealBeam; reason=PROVIDE_INFORMATION\&quot;,\&quot;csaState\&quot;:{\&quot;status\&quot;:\&quot;Pending\&quot;},\&quot;claimantState\&quot;:{\&quot;status\&quot;:\&quot;Pending\&quot;},\&quot;respondentState\&quot;:{\&quot;status\&quot;:\&quot;Pending\&quot;},\&quot;investigationState\&quot;:{\&quot;status\&quot;:\&quot;ActionRequired\&quot;},\&quot;commentsRequired\&quot;:true,\&quot;legacyStatus\&quot;:\&quot;INVG\&quot;,\&quot;claimOpsOverride\&quot;:false},{\&quot;actor\&quot;:{\&quot;role\&quot;:\&quot;CSA\&quot;,\&quot;login\&quot;:\&quot;unknown\&quot;,\&quot;customerId\&quot;:\&quot;A152MSST3GCKQF\&quot;},\&quot;changeDate\&quot;:\&quot;2021-12-28T06:21:15.238Z\&quot;,\&quot;reason\&quot;:\&quot;CANCEL_PROBLEM\&quot;,\&quot;description\&quot;:\&quot;CSA changing state to 'ProblemState(csaState=Resolved, claimantState=Resolved, respondentState=Resolved, investigationState=ActionRequired, legacyStatus=BWDQ)' via HealBeam; reason=CANCEL_PROBLEM\&quot;,\&quot;csaState\&quot;:{\&quot;status\&quot;:\&quot;Resolved\&quot;},\&quot;claimantState\&quot;:{\&quot;status\&quot;:\&quot;Resolved\&quot;},\&quot;respondentState\&quot;:{\&quot;status\&quot;:\&quot;Resolved\&quot;},\&quot;investigationState\&quot;:{\&quot;status\&quot;:\&quot;ActionRequired\&quot;},\&quot;commentsRequired\&quot;:true,\&quot;legacyStatus\&quot;:\&quot;BWDQ\&quot;,\&quot;claimOpsOverride\&quot;:false},{\&quot;actor\&quot;:{\&quot;role\&quot;:\&quot;SeSu\&quot;,\&quot;login\&quot;:\&quot;unknown\&quot;,\&quot;customerId\&quot;:\&quot;A1DI45MUWFG9A6\&quot;},\&quot;changeDate\&quot;:\&quot;2021-12-28T06:21:15.238Z\&quot;,\&quot;reason\&quot;:\&quot;PROVIDE_INFORMATION\&quot;,\&quot;description\&quot;:\&quot;SeSu changing state to 'ProblemState(csaState=Pending, claimantState=Pending, respondentState=Pending, investigationState=ActionRequired, legacyStatus=INVG)' via HealBeam; reason=PROVIDE_INFORMATION\&quot;,\&quot;csaState\&quot;:{\&quot;status\&quot;:\&quot;Pending\&quot;},\&quot;claimantState\&quot;:{\&quot;status\&quot;:\&quot;Pending\&quot;},\&quot;respondentState\&quot;:{\&quot;status\&quot;:\&quot;Pending\&quot;},\&quot;investigationState\&quot;:{\&quot;status\&quot;:\&quot;ActionRequired\&quot;},\&quot;commentsRequired\&quot;:true,\&quot;legacyStatus\&quot;:\&quot;INVG\&quot;,\&quot;claimOpsOverride\&quot;:false}]}&quot;,&quot;avenue&quot;:&quot;CONTACT_SELLER&quot;}" data-csa-c-id="o4f6cx-sxrdb0-fnajui-dbrzyw">
                                <span id="CONTACT_SELLER_button" class="a-button a-button-primary"><span class="a-button-inner"><input class="a-button-input" type="submit" aria-labelledby="CONTACT_SELLER_button-announce"><span id="CONTACT_SELLER_button-announce" class="a-button-text" aria-hidden="true">
                                    
                                        
                                            Send
                                        
                                        
                                    
                                </span></span></span>
                            </span>
                        </span>
                    </div>
                </div>
            </div>
        </div>

I have experience with selenium and have read many possible solutions online which have unfortunately not been of any help. So, anyone who can provide help into what I am missing, I would be greatly appreciative of.

I was able to determine the cause of the problem I had encountered. I am adding an answer for anyone who finds this post of StackOverflow and encounters a similar issue.

For whatever reason, the XPATH I had used to find the element had multiple occurrences within the DOM (was not outright obvious to me at the time). Consequently, when I performed a find_element_by_xpath, I was clicking on the first element in the array. To get the code to work as expected, I had to perform a find_elements_by_xpath and click on the last WebElement in the array.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM