JMP 18 で Python を使用して Selenium を操作するにはどうすればよいでしょうか?Web ページの内容を自動的にキャプチャし、実際の URL を取得したいと考えています。
例えば、
https://xvfr.com/60s.html
その本質は写真だけです 実際のウェブサイトhttps://g.gtimg.cn/music/photo_new/T053XD001001eyb6g4JwXRW.png
この画像アドレスのコンテンツはページのソースコードにはありません。ただし、毎日異なるアドレスになります。
JMP Pythonに以下のライブラリをインストールしました
jmputils.jpip('install', 'selenium')
jmputils.jpip('install', 'requests')専門家の皆さん、ありがとう!
基本的なデータ分析とモデリングウィンドウズRe: Python を使用して JMP 18 で Selenium を操作するにはどうすればよいでしょうか?画像からテキストを取得する必要がある場合、それは OCR (光学文字認識) と呼ばれます。私はまだ試したことがありませんが、pytesseract がそれを処理できそうです。多くの言語をサポートしていると主張しています。
Re: Python を使用して JMP 18 で Selenium を操作するにはどうすればよいでしょうか?画像OCRを解決しました。

要は、この画像のアドレスは毎日違うので手動で取得したくないのです。
Craige Expert のオリジナルブログをご覧ください。でも複雑すぎてわかりません。
そこで、このウェブサイトの写真の実際のアドレスを自動的に取得したいと思います。
クレイグさんありがとう!
Re: Python を使用して JMP 18 で Selenium を操作するにはどうすればよいでしょうか?ここで、JMP 18 Python を組み合わせて、この画像の異なるアドレスを毎日自動的に取得し、JSL をダウンロードして認識する方法を理解したいと思います。
Re: Python を使用して JMP 18 で Selenium を操作するにはどうすればよいでしょうか?チャットGPT

私はPythonについてさらによく知りません。ありがとうございます!
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
import time
# Set the path to your ChromeDriver
service = Service(executable_path="path/to/chromedriver")
# Initialize the browser
options = webdriver.ChromeOptions()
options.add_argument('--headless') # Run in headless mode to avoid opening a browser window
browser = webdriver.Chrome(service=service, options=options)
# Visit the target webpage
browser.get("https://xvfr.com/60s.html")
# Wait for the page to load
time.sleep(5) # Wait 5 seconds for the page to load completely; you can use WebDriverWait for better handling
# Get all network requests
logs = browser.get_log('performance')
# Parse network requests to find the image URL
for log in logs:
if 'https://g.gtimg.cn/music/photo_new' in str(log):
print("Found image URL:", str(log))
# Close the browser
browser.quit()