每当我尝试使用python selenium和Firefox驱动程序点击 ProfileTweet-action 时,我得到了下拉列表,其中包含删除twitt的选项,但相同的代码不适用于PhantomJS。为什么以及如何克服这个?
<div class="ProfileTweet-action ProfileTweet-action--more js-more-Prof ileTweet-actions">
<div class="dropdown">
<button class="ProfileTweet-actionButton u-textUserColorHover dropdown-toggle js-dropdown-toggle" type="button" aria-haspopup="true" id="menu-0">
<div class="IconContainer js-tooltip" title="More">
<span class="Icon Icon--caretDownLight Icon--small"></span>
<span class="u-hiddenVisually">More</span>
</div>
</button>
<div class="dropdown-menu is-autoCentered">
<div class="dropdown-caret">
<div class="caret-outer"></div>
<div class="caret-inner"></div>
</div>
<ul tabindex="-1" role="menu" aria-labelledby="menu-0" aria-hidden="true">
<li class="share-via-dm js-actionShareViaDM" data-nav="share_tweet_dm" role="presentation">
<button type="button" class="dropdown-link" role="menuitem">Share via Direct Message</button>
</li>
<li class="copy-link-to-tweet js-actionCopyLinkToTweet" role="presentation">
<button type="button" class="dropdown-link" role="menuitem">Copy link to Tweet</button>
</li>
<li class="embed-link js-actionEmbedTweet" data-nav="embed_tweet" role="presentation">
<button type="button" class="dropdown-link" role="menuitem">Embed Tweet</button>
</li>
<li class="user-pin-tweet js-actionPinTweet" data-nav="user_pin_tweet" role="presentation">
<button type="button" class="dropdown-link" role="menuitem">Pin to your profile page</button>
</li>
<li class="user-unpin-tweet js-actionPinTweet" data-nav="user_unpin_tweet" role="presentation">
<button type="button" class="dropdown-link">Unpin from profile page</button>
</li>
<li class="js-actionDelete" role="presentation">
<button type="button" class="dropdown-link" role="menuitem">Delete Tweet</button>
</li>
<li class="dropdown-divider" role="presentation"></li>
<li class="js-actionMomentMakerAddTweetToOtherMoment MomentMakerAddTweetToOtherMoment" role="presentation" style="display: none;">
<button type="button" class="dropdown-link">Add to other Moment</button>
</li>
<li class="js-actionMomentMakerCreateMoment" role="presentation">
<button type="button" class="dropdown-link" role="menuitem">Add to new Moment</button>
</li>
</ul>
</div>
</div>
</div>