找回密码
 加入
搜索
查看: 656|回复: 5

[求购] 一个链接想从PC访问到它的手机版 200RMB

[复制链接]
发表于 2022-7-21 21:31:41 | 显示全部楼层 |阅读模式
悬赏200金钱未解决
本帖最后由 z761003 于 2022-7-23 02:42 编辑

一个网址 https://m.xuangubao.cn/top-gainer 用PC和手机访问出来的页面是不同的,这个页面我想把它嵌入到AU3里,让用户看到的是手机版的内容,据说要改userAgent,有以下方法之一都可接受:

1,AU3上有什么方法
2、能不能用JS代码,把它包在一个html文件里,再用JS去GET或啥的
3、在服务器上弄个PHP什么的,把网址包在里面,AU3访问这个PHP

这些方法任意一个都可以,只要最终AU3上能看到手机版的界面即可

附件: 您需要 登录 才可以下载或查看,没有账号?加入
发表于 2022-7-23 20:54:49 | 显示全部楼层
测一些手机网页的自动化非常好用。

下面是java执行代码。使用谷歌模拟手机,进行浏览网页。运行时注意chromedriver.exe的安装路径。
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;

import java.util.HashMap;

public class temp {

    public static void main(String[] args) {
        System.setProperty("webdriver.chrome.driver", ".\\drivers\\chromedriver.exe");
        String URL = "https://www.baidu.com";

        HashMap<String,String>  mobileEmulation = new HashMap<String,String>();
        mobileEmulation.put("deviceName","iPhone X");
        ChromeOptions options = new ChromeOptions();
        options.setExperimentalOption("mobileEmulation", mobileEmulation);
        WebDriver driver = new ChromeDriver(options);
        driver.get(URL);    //进入目的链接
    }
}
python执行代码
from selenium import webdriver

mobileEmulation = {'deviceName': 'Apple iPhone 4'}
options = webdriver.ChromeOptions()
options.add_experimental_option('mobileEmulation', mobileEmulation)
driver = webdriver.Chrome(executable_path='chromedriver.exe', chrome_options=options)
driver.get('http://m.baidu.com')
发表于 2022-7-24 10:17:47 | 显示全部楼层
试过没有

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
 楼主| 发表于 2022-7-28 00:15:04 | 显示全部楼层
h012031 发表于 2022-7-23 20:54
测一些手机网页的自动化非常好用。

下面是java执行代码。使用谷歌模拟手机,进行浏览网页。运行时注意ch ...

这样做好像就无法嵌入AU3了
 楼主| 发表于 2022-7-28 00:23:09 | 显示全部楼层

试了,没成功 ……我字串是改成 ……
Mozilla/5.0 (Linux; U; Android 7.0; zh-CN; PRO 7-S Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/57.0.2987.108 UCBrowser/11.9.4.974 UWS/2.13.2.46 Mobile Safari/537.36 AliApp(DingTalk/4.6.29) com.alibaba.android.rimet/11388461 Channel/10002068 language/zh-CN
另外即使成功了,好像让用户每次这么改也不太方便,有便捷的能过程序行为就能搞定的方案么
发表于 2022-9-29 09:53:20 | 显示全部楼层
此人是骗子,谨防上当受骗。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-4-25 19:48 , Processed in 0.077555 second(s), 18 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表