We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
使用demo 跑这个baidu.com没有问题 这个地址不行 https://ysotmain.ysclass.net/zhxy/#/redirect/login
The text was updated successfully, but these errors were encountered:
public static void main(String[] args) throws IOException, ExecutionException, InterruptedException { //自动下载,第一次下载后不会再下载 // BrowserFetcher.downloadIfNotExist(null); ArrayList<String> arrayList = new ArrayList<>(); //生成pdf必须在无头模式下才能生效 LaunchOptions options = new LaunchOptionsBuilder().withArgs(arrayList).withHeadless(true).build(); options.setExecutablePath("D:\\workSoftware\\chrome-win\\chrome.exe"); arrayList.add("--no-sandbox"); arrayList.add("--disable-setuid-sandbox"); Browser browser = Puppeteer.launch(options); Page page = browser.newPage(); HashMap<String, String> map = Maps.newHashMap(); map.put("Authorization","Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJvcGVuQWNjb3VudElkIjoiOTUwNzI2OTI4MTg3NTMxMjY0IiwidGVuYW50SWQiOiI2Nzk3NzczMzk3MjIzMDU1MzYiLCJwbGF0Zm9ybVR5cGUiOiJwYyIsImlkIjoiOTUwNzI2OTI4MzM0MzMxOTA1Iiwib3BlblVzZXJJbmZvSWQiOiI5NTA1MDcwNjYyMjM2Mjk5MjkiLCJ1c2VyTmFtZSI6IjEzNjUwNzA4MzUzIiwiZXhwIjoxNzExMDQ0MDAwLCJvcmdJZCI6IjY3OTY3NTc4MzA3NzMwNDUxNCIsInVzZXJJbmZvSWQiOiI5NTA3MjY5MjgzMzQzMzE5MDQiLCJjcmVhdGVUaW1lc3RhbXAiOiIxNzA4NTAyMzU1MjIyIn0.Fz1Yk4ErfWgnNS2WFrF-FIpZOVKNg3MxGTesu_sLiJs"); map.put("User-Agent","Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"); page.setExtraHTTPHeaders(map); page.goTo("https://ysotmain.ysclass.net/zhxy/#/redirect/login"); PDFOptions pdfOptions = new PDFOptions(); pdfOptions.setPath("testA2233.pdf"); page.pdf(pdfOptions); page.close(); browser.close(); }
Sorry, something went wrong.
No branches or pull requests
使用demo 跑这个baidu.com没有问题
这个地址不行
https://ysotmain.ysclass.net/zhxy/#/redirect/login
The text was updated successfully, but these errors were encountered: