実現したいこと
以下のコード内のsrcに記載されている/_next/image?url=%2FSprites%2Ft_Skill_Absol_S21.png&w=96&q=75を文字列として取得したいです.
<img alt="Pokemon ability 1" src="/_next/image?url=%2FSprites%2Ft_Skill_Absol_S21.png&w=96&q=75" decoding="async" data-nimg="fixed" srcset="/_next/image?url=%2FSprites%2Ft_Skill_Absol_S21.png&w=48&q=75 1x, /_next/image?url=%2FSprites%2Ft_Skill_Absol_S21.png&w=96&q=75 2x" style="position: absolute; inset: 0px; box-sizing: border-box; padding: 0px; border: none; margin: auto; display: block; width: 0px; height: 0px; min-width: 100%; max-width: 100%; min-height: 100%; max-height: 100%;">
発生している問題・
取得した情報が以下のようにbase64形式になっています.
これを/_next/image?url=%2FSprites%2Ft_Skill_Absol_S21.png&w=96&q=75という文字列として取得したいです.
data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
該当のソースコード
以下のコードで文字列の取得を行おうと考えました.
*pokemon_pathは取得したい情報の記載部分のXPathになります.
Python
1pokemon_name = driver.find_element(By.XPATH, pokemon_path) 2data = pokemon_name.get_attribute('src')
打ち消し線

バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2022/07/20 09:21
2022/07/20 10:03