2017-11-12 13 views
0

私はあなたの助けが必要です。私は地図をズームアウトしたいと思いますし、それをやる方法がわかりません。何か教えていただけますか?セレンとpython 3.xを使ってこのウェブサイトをズームアウトする方法は?

<div draggable="false" style="-moz-user-select: none; box-shadow: 0px 1px 4px -1px rgba(0, 0, 0, 0.3); border-radius: 2px; cursor: pointer; background-color: rgb(255, 255, 255); width: 28px; height: 55px;"> 
    <div title="zoom_in" aria-label="zoom_in" tabindex="0" style="position: relative; width: 28px; height: 27px; left: 0px; top: 0px;"> 
     <div style="overflow: hidden; position: absolute; width: 15px; height: 15px; left: 7px; top: 6px;"><img style="position: absolute; left: 0px; top: 0px; -moz-user-select: none; border: 0px none; padding: 0px; margin: 0px; max-width: none; width: 120px; height: 54px;" src="https://maps.gstatic.com/mapfiles/api-3/images/tmapctrl.png" draggable="false"></div> 
    </div> 
    <div style="position: relative; overflow: hidden; width: 67%; height: 1px; left: 16%; background-color: rgb(230, 230, 230); top: 0px;"></div> 
    <div title="zoom_out" aria-label="zoom_out" tabindex="0" style="position: relative; width: 28px; height: 27px; left: 0px; top: 0px;"> 
     <div style="overflow: hidden; position: absolute; width: 15px; height: 15px; left: 7px; top: 6px;"><img style="position: absolute; left: 0px; top: -15px; -moz-user-select: none; border: 0px none; padding: 0px; margin: 0px; max-width: none; width: 120px; height: 54px;" src="https://maps.gstatic.com/mapfiles/api-3/images/tmapctrl.png" draggable="false"></div> 
    </div> 
</div> 

私が試した:

browser.find_elements_by_name("zoom_out") 

そして、残念ながら、それは動作しませんが。

答えて

0

私はそれをしました。解決策は次のとおりです。

browser.find_elements_by_xpath("//div[@title='zoom_out' and @aria-label='zoom_out']") 
関連する問題