我试图用硒和铬来显示this page中的所有价格,然后截图。默认情况下,我们只能看到3个价格。不管怎样,还是要禁用slick-slider以便我可以看到所有5个价格。我试着将每个plansSlider slick-initialized slick-sliderdiv class="plansSlider slick-initialized slick-slider"中移除,但似乎都不起作用。
做这件事的正确方法是什么?
以下是HTML:

<div class="plansSlider slick-initialized slick-slider" role="toolbar"><button type="button" class="planTable-prev ico-arrow-left slick-arrow slick-disabled" aria-disabled="true" style="display: block;">Previous</button>
<div aria-live="polite" class="slick-list draggable"><div class="slick-track" style="opacity: 1; width: 1640px; left: 0px;" role="listbox"><div class="slick-slide slick-current slick-active" data-slick-index="0" aria-hidden="false" style="width: 328px;" tabindex="-1" role="option" aria-describedby="slick-slide00">
<div class="swiper-slide columns">
<div class="plan">
<div data-equalizer-listener="plan-heading" class="plan-header">
<div class="prices">
<div class="col total">
<div class="price"><sup>$</sup><span class="amount">15</span> <span class="caption">per month</span></div>
</div>

<p class="min-payment">Min. Total Cost is $360 over 24 months excluding any discounts.</p>
</div>
</div>

<div class="features">
<div class="feature first" data-equalizer-selector="included-data" style="min-height: 160px;">
<div class="description"><span class="highlight-text">2GB DATA</span><br>
<span class="legal">Cost of 1MB included data $0.0073</span> <span class="legal">$10 per extra 1 GB</span></div>
</div>

<div class="feature first" data-equalizer-selector="data-pool" style="min-height: 76px;">
<div class="description"><span class="">Data Pool</span></div>

<div class="more-talk-info hide hide" data-information="included-data">
<div class="description column" style=" margin-top: 1em;"><span class="legal">Combine any of our latest My Plan Plus (including SIM only) and My Mobile Broadband Plus plans on the one bill to pool and share data.</span></div>
</div>

<div><a class="more-talk-link" href="#" data-information="included-data" tabindex="0">more</a></div>
</div>

<!-- Included Entertainment -->
<div class="feature standard" style=" min-height: 220px;">
<div class="description"><span>Included Entertainment</span></div>

<div class="icon-container description"><img alt="Music Streaming logo" src="//smb.optus.com.au/opfiles/Shop/Consumer/Assets/Images/Entertainment/music-icon.png" style=" width: 68px; padding-bottom: 15px; margin: 0px auto; display: inline-block;"></div>

<div class="icon-container description">
<p class="legal">Discover more entertainment options</p>
</div>

<div class="more-ent-info" data-information="included-entertainment">
<div class="description column" style=" margin-top: 1em;">
<div class="large-3 medium-2 small-4 left"><img alt="Music Streaming logo" src="//smb.optus.com.au/opfiles/Shop/Consumer/Assets/Images/Entertainment/music-icon.png" style=" width: 75%;"></div>

<div class="large-9 medium-10 small-8 left textLeft"><span style=" display: block;">Music Streaming</span><span class="legal"><b>(Not suitable for modems)</b></span> <span class="legal">Stream music on Google Play Music, iHeartRadio and Spotify mobile apps without using your plan's data.</span></div>
</div>

<div class="description column" style=" margin-top: 1em;"><span class="textLeft" style=" display: block;">Optional</span></div>

<div class="description column" style=" margin-top: 2em;">
<div class="large-3 medium-2 small-4 left"><img src="//smb.optus.com.au/opfiles/Shop/Consumer/Assets/Images/Entertainment/tv-icon.png" style=" width: 75%;"></div>

<div class="large-9 medium-10 small-8 left textLeft"><span style=" display: block;">Mobile TV Streaming</span><span class="legal">Stream selected streaming services without using plan data. $10p/m. <a href="#svod" tabindex="0">See more</a><br>
<strong><small>Additional Fees apply</small></strong></span></div>
</div>
</div>

<div><a class="more-ent-link" href="#" data-information="included-entertainment" tabindex="0">less</a></div>
</div>

<div data-equalizer-listener="footer" class="plan-footer">
<p class="restriction">All for use within Australia.</p>

<div class="large-12"><a class="yellow button" href="http://www.optus.com.au/shop/tablet/devices" style=" font-size: 16px;" tabindex="0">Shop Tablets</a> <a class="yellow button" href="http://www.optus.com.au/shop/broadband/mobilebroadband" style=" font-size: 16px;" tabindex="0">Shop Modems</a></div>

<br>
<p class="cis">&nbsp;<a target="_blank" class="cis-link" href="//smb.optus.com.au/opfiles/Shop/All/cis/Cis%20Documents/1415704_CIS_$15_My_Mobile_Broadband_Plus_2GB.pdf" tabindex="0">Critical Information Summary</a></p>
</div>
</div>
</div>
</div>
</div><div class="slick-slide slick-active" data-slick-index="1" aria-hidden="false" style="width: 328px;" tabindex="-1" role="option" aria-describedby="slick-slide01">
<div class="swiper-slide columns">
<div class="plan ">
<div data-equalizer-listener="plan-heading" class="plan-header">
<div class="prices">
<div class="col total">
<div class="price"><sup>$</sup> <span class="amount">25</span> <span class="caption">per month</span></div>
</div>

<p class="min-payment">Min. Total Cost is $600 over 24 months excluding any discounts.</p>
</div>
</div>

<div class="features">
<div class="feature standard first" data-equalizer-selector="included-data" style="min-height: 160px;">
<div class="description"><span class="highlight-text">5GB DATA</span><br>
<span class="legal">Cost of 1MB included data $0.0049</span> <span class="legal">$10 per extra 1 GB</span></div>
</div>

<div class="feature first" data-equalizer-selector="data-pool" style="min-height: 76px;">
<div class="description"><span class="">Data Pool</span></div>

<div class="more-talk-info hide hide" data-information="included-data">
<div class="description column" style=" margin-top: 1em;"><span class="legal">Combine any of our latest My Plan Plus (including SIM only) and My Mobile Broadband Plus plans on the one bill to pool and share data.</span></div>
</div>

<div><a class="more-talk-link" href="#" data-information="included-data" tabindex="0">more</a></div>
</div>

<!-- Included Entertainment -->
<div class="feature standard" style=" min-height: 220px;">
<div class="description"><span>Included Entertainment</span></div>

<div class="icon-container description"><img alt="Music Streaming logo" src="//smb.optus.com.au/opfiles/Shop/Consumer/Assets/Images/Entertainment/music-icon.png" style=" width: 68px; padding-bottom: 15px; margin: 0px auto; display: inline-block;"></div>

<div class="icon-container description">
<p class="legal">Discover more entertainment options</p>
</div>

<div class="more-ent-info" data-information="included-entertainment">
<div class="description column" style=" margin-top: 1em;">
<div class="large-3 medium-2 small-4 left"><img alt="Music Streaming logo" src="//smb.optus.com.au/opfiles/Shop/Consumer/Assets/Images/Entertainment/music-icon.png" style=" width: 75%;"></div>

<div class="large-9 medium-10 small-8 left textLeft"><span style=" display: block;">Music Streaming</span><span class="legal"><b>(Not suitable for modems)</b></span> <span class="legal">Stream music on Google Play Music, iHeartRadio and Spotify mobile apps without using your plan's data.</span></div>
</div>

<div class="description column" style=" margin-top: 1em;"><span class="textLeft" style=" display: block;">Optional</span></div>

<div class="description column" style=" margin-top: 2em;">
<div class="large-3 medium-2 small-4 left"><img src="//smb.optus.com.au/opfiles/Shop/Consumer/Assets/Images/Entertainment/tv-icon.png" style=" width: 75%;"></div>

<div class="large-9 medium-10 small-8 left textLeft"><span style=" display: block;">Mobile TV Streaming</span><span class="legal">Stream selected streaming services without using plan data. $10p/m. <a href="#svod" tabindex="0">See more</a><br>
<strong><small>Additional Fees apply</small></strong></span></div>
</div>
</div>

<div><a class="more-ent-link" href="#" data-information="included-entertainment" tabindex="0">less</a></div>
</div>

<div data-equalizer-listener="footer" class="plan-footer">
<p class="restriction">All for use within Australia.</p>

<div class="large-12"><a class="yellow button" href="http://www.optus.com.au/shop/tablet/devices" style=" font-size: 16px;" tabindex="0">Shop Tablets</a> <a class="yellow button" href="http://www.optus.com.au/shop/broadband/mobilebroadband" style=" font-size: 16px;" tabindex="0">Shop Modems</a></div>

<br>
<p class="cis">&nbsp;<a target="_blank" class="cis-link" href="//smb.optus.com.au/opfiles/Shop/All/cis/Cis%20Documents/1415705_CIS_$25_My_Mobile_Broadband_Plus_5GB.pdf" tabindex="0">Critical Information Summary</a></p>
</div>
</div>
</div>
</div>
</div><div class="slick-slide slick-active" data-slick-index="2" aria-hidden="false" style="width: 328px;" tabindex="-1" role="option" aria-describedby="slick-slide02">
<div class="swiper-slide columns">
<div class="plan">
<div data-equalizer-listener="plan-heading" class="plan-header">
<div class="prices">
<div class="col total">
<div class="price"><sup>$</sup> <span class="amount">35</span> <span class="caption">per month</span></div>
</div>

<p class="min-payment">Min. Total Cost is $840 over 24 months excluding any discounts.</p>
</div>
</div>

<div class="features">
<div class="feature PO_Included_Data standard first" data-equalizer-selector="included-data" style="min-height: 160px;">
<div class="description"><span class="highlight-text">10GB DATA</span><br>
<span class="legal">Cost of 1MB included data $0.0034</span> <span class="legal">$10 per extra 1 GB</span></div>
</div>

<div class="feature first" data-equalizer-selector="data-pool" style="min-height: 76px;">
<div class="description"><span class="">Data Pool</span></div>

<div class="more-talk-info hide hide" data-information="included-data">
<div class="description column" style=" margin-top: 1em;"><span class="legal">Combine any of our latest My Plan Plus (including SIM only) and My Mobile Broadband Plus plans on the one bill to pool and share data.</span></div>
</div>

<div><a class="more-talk-link" href="#" data-information="included-data" tabindex="0">more</a></div>
</div>

<!-- Included Entertainment -->
<div class="feature standard">
<div class="description"><span>Included Entertainment</span></div>

<div class="icon-container description"><img alt="Music Streaming logo" src="//smb.optus.com.au/opfiles/Shop/Consumer/Assets/Images/Entertainment/music-icon.png" style=" width: 68px; padding-bottom: 15px; margin: 0px auto; display: inline-block;"><img src="//smb.optus.com.au/opfiles/Shop/Consumer/Assets/Images/Entertainment/tv-icon.png" style=" width: 68px; padding-bottom: 15px; margin: 0px auto; display: inline-block;"><img src="//smb.optus.com.au/opfiles/Shop/Consumer/Assets/Images/Entertainment/epl-icon.png" style=" width: 68px; padding-bottom: 15px; margin: 0px auto; display: inline-block;"></div>

<div class="icon-container description">
<p class="legal">Discover more entertainment options</p>
</div>

<div class="more-ent-info" data-information="included-entertainment">
<div class="description column" style=" margin-top: 1em;">
<div class="large-3 medium-2 small-4 left"><img alt="Music Streaming logo" src="//smb.optus.com.au/opfiles/Shop/Consumer/Assets/Images/Entertainment/music-icon.png" style=" width: 75%;"></div>

<div class="large-9 medium-10 small-8 left textLeft"><span style=" display: block;">Music Streaming</span><span class="legal"><b>(Not suitable for modems)</b></span> <span class="legal">Stream music on Google Play Music, iHeartRadio and Spotify mobile apps without using your plan's data.</span></div>
</div>

<div class="description column" style=" margin-top: 2em;">
<div class="large-3 medium-2 small-4 left"><img src="//smb.optus.com.au/opfiles/Shop/Consumer/Assets/Images/Entertainment/tv-icon.png" style=" width: 75%;"></div>

<div class="large-9 medium-10 small-8 left textLeft"><span style=" display: block;">Mobile TV Streaming</span><span class="legal">Stream selected streaming services without using plan data. <a href="#svod" tabindex="0">See more</a></span></div>
</div>

<div class="description column" style=" margin-top: 1em;">
<div class="large-3 medium-2 small-4 left"><img src="//smb.optus.com.au/opfiles/Shop/Consumer/Assets/Images/Entertainment/epl-icon.png" style=" width: 75%;"></div>

<div class="large-9 medium-10 small-8 left textLeft"><span style=" display: block;">OPTUS SPORT</span> <span class="legal">Optus Sport subscription included at no extra charge.</span></div>
</div>
</div>

<div><a class="more-ent-link" href="#" data-information="included-entertainment" tabindex="0">less</a></div>
</div>

<div data-equalizer-listener="footer" class="plan-footer">
<p class="restriction">All for use within Australia.</p>

<div class="large-12"><a class="yellow button" href="http://www.optus.com.au/shop/tablet/devices" style=" font-size: 16px;" tabindex="0">Shop Tablets</a> <a class="yellow button" href="http://www.optus.com.au/shop/broadband/mobilebroadband" style=" font-size: 16px;" tabindex="0">Shop Modems</a></div>

<br>
<p class="cis">&nbsp;<a target="_blank" class="cis-link" href="//smb.optus.com.au/opfiles/Shop/All/cis/Cis%20Documents/1415713_CIS_$35_My_Mobile_Broadband_Plus_10GB.pdf" tabindex="0">Critical Information Summary</a></p>
</div>
</div>
</div>
</div>
</div><div class="slick-slide" data-slick-index="3" aria-hidden="true" style="width: 328px;" tabindex="-1" role="option" aria-describedby="slick-slide03">
<div class="swiper-slide columns">
<div class="plan">
<div data-equalizer-listener="plan-heading" class="plan-header">
<div class="prices">
<div class="col total">
<div class="price"><sup>$</sup><span class="amount">50</span> <span class="caption">per month</span></div>
</div>

<p class="min-payment">Min. Total Cost is $1200 over 24 months excluding any discounts.</p>
</div>
</div>

<div class="features">
<div class="feature standard first" data-equalizer-selector="included-data" style="min-height: 160px;">
<div class="description"><span class="highlight-text">25GB DATA</span><br>
<span class="legal">Cost of 1MB included data $0.0019</span> <span class="legal">$10 per extra 1 GB</span></div>
</div>

<div class="feature first" data-equalizer-selector="data-pool" style="min-height: 76px;">
<div class="description"><span class="">Data Pool</span></div>

<div class="more-talk-info hide hide" data-information="included-data">
<div class="description column" style=" margin-top: 1em;"><span class="legal">Combine any of our latest My Plan Plus (including SIM only) and My Mobile Broadband Plus plans on the one bill to pool and share data.</span></div>
</div>

<div><a class="more-talk-link" href="#" data-information="included-data" tabindex="-1">more</a></div>
</div>

<!-- Included Entertainment -->
<div class="feature standard">
<div class="description"><span>Included Entertainment</span></div>

<div class="icon-container description"><img alt="Music Streaming logo" src="//smb.optus.com.au/opfiles/Shop/Consumer/Assets/Images/Entertainment/music-icon.png" style=" width: 68px; padding-bottom: 15px; margin: 0px auto; display: inline-block;"><img src="//smb.optus.com.au/opfiles/Shop/Consumer/Assets/Images/Entertainment/tv-icon.png" style=" width: 68px; padding-bottom: 15px; margin: 0px auto; display: inline-block;"><img src="//smb.optus.com.au/opfiles/Shop/Consumer/Assets/Images/Entertainment/epl-icon.png" style=" width: 68px; padding-bottom: 15px; margin: 0px auto; display: inline-block;"></div>

<div class="icon-container description">
<p class="legal">Discover more entertainment options</p>
</div>

<div class="more-ent-info" data-information="included-entertainment">
<div class="description column" style=" margin-top: 1em;">
<div class="large-3 medium-2 small-4 left"><img alt="Music Streaming logo" src="//smb.optus.com.au/opfiles/Shop/Consumer/Assets/Images/Entertainment/music-icon.png" style=" width: 75%;"></div>

<div class="large-9 medium-10 small-8 left textLeft"><span style=" display: block;">Music Streaming</span><span class="legal"><b>(Not suitable for modems)</b></span> <span class="legal">Stream music on Google Play Music, iHeartRadio and Spotify mobile apps without using your plan's data.</span></div>
</div>

<div class="description column" style=" margin-top: 2em;">
<div class="large-3 medium-2 small-4 left"><img src="//smb.optus.com.au/opfiles/Shop/Consumer/Assets/Images/Entertainment/tv-icon.png" style=" width: 75%;"></div>

<div class="large-9 medium-10 small-8 left textLeft"><span style=" display: block;">Mobile TV Streaming</span><span class="legal">Stream selected streaming services without using plan data. <a href="#svod" tabindex="-1">See more</a></span></div>
</div>

<div class="description column" style=" margin-top: 1em;">
<div class="large-3 medium-2 small-4 left"><img src="//smb.optus.com.au/opfiles/Shop/Consumer/Assets/Images/Entertainment/epl-icon.png" style=" width: 75%;"></div>

<div class="large-9 medium-10 small-8 left textLeft"><span style=" display: block;">OPTUS SPORT</span> <span class="legal">Optus Sport subscription included at no extra charge.</span></div>
</div>
</div>

<div><a class="more-ent-link" href="#" data-information="included-entertainment" tabindex="-1">less</a></div>
</div>

<div data-equalizer-listener="footer" class="plan-footer">
<p class="restriction">All for use within Australia.</p>

<div class="large-12"><a class="yellow button" href="http://www.optus.com.au/shop/tablet/devices" style=" font-size: 16px;" tabindex="-1">Shop Tablets</a> <a class="yellow button" href="http://www.optus.com.au/shop/broadband/mobilebroadband" style=" font-size: 16px;" tabindex="-1">Shop Modems</a></div>

<br>
<p class="cis">&nbsp;<a target="_blank" class="cis-link" href="//smb.optus.com.au/opfiles/Shop/All/cis/Cis%20Documents/1415706_CIS_$50_My_Mobile_Broadband_Plus_25GB.pdf" tabindex="-1">Critical Information Summary</a></p>
</div>
</div>
</div>
</div>
</div><div class="slick-slide" data-slick-index="4" aria-hidden="true" style="width: 328px;" tabindex="-1" role="option" aria-describedby="slick-slide04">
<div class="swiper-slide columns">
<div class="plan recommended">
<div class="recommended-badge"><span>GREAT VALUE!</span></div>

<div data-equalizer-listener="plan-heading" class="plan-header">
<div class="prices">
<div class="col total">
<div class="price"><sup>$</sup><span class="amount">70</span> <span class="caption">per month</span></div>
</div>

<p class="min-payment">Min. Total Cost is $1680 over 24 months excluding any discounts.</p>
</div>
</div>

<div class="features">
<div class="feature standard first" data-equalizer-selector="included-data" style="min-height: 160px;">
<div class="description"><span class="highlight-text">100GB DATA</span><br>
<p class="legal">Online - New services only.</p>

<span class="legal">Cost of 1MB included data $0.0007</span> <span class="legal">$10 per extra 1 GB</span></div>
</div>

<div class="feature first" data-equalizer-selector="data-pool" style="min-height: 76px;">
<div class="description"><span class="">Data Pool</span></div>

<div class="more-talk-info hide hide" data-information="included-data">
<div class="description column" style=" margin-top: 1em;"><span class="legal">Combine any of our latest My Plan Plus (including SIM only) and My Mobile Broadband Plus plans on the one bill to pool and share data.</span></div>
</div>

<div><a class="more-talk-link" href="#" data-information="included-data" tabindex="-1">more</a></div>
</div>

<!-- Included Entertainment -->
<div class="feature standard">
<div class="description"><span>Included Entertainment</span></div>

<div class="icon-container description"><img alt="Music Streaming logo" src="//smb.optus.com.au/opfiles/Shop/Consumer/Assets/Images/Entertainment/music-icon.png" style=" width: 68px; padding-bottom: 15px; margin: 0px auto; display: inline-block;"><img src="//smb.optus.com.au/opfiles/Shop/Consumer/Assets/Images/Entertainment/tv-icon.png" style=" width: 68px; padding-bottom: 15px; margin: 0px auto; display: inline-block;"><img src="//smb.optus.com.au/opfiles/Shop/Consumer/Assets/Images/Entertainment/epl-icon.png" style=" width: 68px; padding-bottom: 15px; margin: 0px auto; display: inline-block;"></div>

<div class="icon-container description">
<p class="legal">Discover more entertainment options</p>
</div>

<div class="more-ent-info" data-information="included-entertainment">
<div class="description column" style=" margin-top: 1em;">
<div class="large-3 medium-2 small-4 left"><img alt="Music Streaming logo" src="//smb.optus.com.au/opfiles/Shop/Consumer/Assets/Images/Entertainment/music-icon.png" style=" width: 75%;"></div>

<div class="large-9 medium-10 small-8 left textLeft"><span style=" display: block;">Music Streaming</span><span class="legal"><b>(Not suitable for modems)</b></span> <span class="legal">Stream music on Google Play Music, iHeartRadio and Spotify mobile apps without using your plan's data.</span></div>
</div>

<div class="description column" style=" margin-top: 2em;">
<div class="large-3 medium-2 small-4 left"><img src="//smb.optus.com.au/opfiles/Shop/Consumer/Assets/Images/Entertainment/tv-icon.png" style=" width: 75%;"></div>

<div class="large-9 medium-10 small-8 left textLeft"><span style=" display: block;">Mobile TV Streaming</span><span class="legal">Stream selected streaming services without using plan data. <a href="#svod" tabindex="-1">See more</a></span></div>
</div>

<div class="description column" style=" margin-top: 1em;">
<div class="large-3 medium-2 small-4 left"><img src="//smb.optus.com.au/opfiles/Shop/Consumer/Assets/Images/Entertainment/epl-icon.png" style=" width: 75%;"></div>

<div class="large-9 medium-10 small-8 left textLeft"><span style=" display: block;">OPTUS SPORT</span> <span class="legal">Optus Sport subscription included at no extra charge.</span></div>
</div>
</div>

<div><a class="more-ent-link" href="#" data-information="included-entertainment" tabindex="-1">less</a></div>
</div>

<div data-equalizer-listener="footer" class="plan-footer">
<p class="restriction">All for use within Australia.</p>

<div class="large-12"><a class="yellow button" href="http://www.optus.com.au/shop/tablet/devices" style=" font-size: 16px;" tabindex="-1">Shop Tablets</a> <a class="yellow button" href="http://www.optus.com.au/shop/broadband/mobilebroadband" style=" font-size: 16px;" tabindex="-1">Shop Modems</a></div>

<br>
<p class="cis">&nbsp;<a target="_blank" class="cis-link" href="//smb.optus.com.au/opfiles/Shop/All/cis/Cis Documents/800689_CIS_70_My_Mobile_Broadband_Plus_100GB_0517_O.PDF" tabindex="-1">Critical Information Summary</a></p>
</div>
</div>
</div>
</div>
</div></div></div>








<button type="button" class="planTable-next ico-arrow-right slick-arrow" style="display: block;" aria-disabled="false">Next</button><ul class="slick-dots" style="display: block;" role="tablist"><li class="slick-active" aria-hidden="false" role="presentation" aria-selected="true" aria-controls="navigation00" id="slick-slide00"><button type="button" data-role="none" role="button" aria-required="false" tabindex="0">1</button></li><li aria-hidden="true" class="" role="presentation" aria-selected="false" aria-controls="navigation01" id="slick-slide01"><button type="button" data-role="none" role="button" aria-required="false" tabindex="0">2</button></li><li aria-hidden="true" role="presentation" aria-selected="false" aria-controls="navigation02" id="slick-slide02" class=""><button type="button" data-role="none" role="button" aria-required="false" tabindex="0">3</button></li><li aria-hidden="true" role="presentation" aria-selected="false" aria-controls="navigation03" id="slick-slide03" class=""><button type="button" data-role="none" role="button" aria-required="false" tabindex="0">4</button></li><li aria-hidden="true" role="presentation" aria-selected="false" aria-controls="navigation04" id="slick-slide04"><button type="button" data-role="none" role="button" aria-required="false" tabindex="0">5</button></li></ul></div>

最佳答案

在控制台上,如果您更改以下css,您将能够看到5列。
删除:

.row {
    max-width: 75em;
}

然后添加:
.slick-slider .slick-track, .slick-slider .slick-list {
    width: 100% !important;
}

.slick-slide {
    width: 20% !important;
    display: block !important;
}

关于python - 使用Selenium添加新CSS,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/48573402/

10-13 04:48