如何使用javascript或jquery自动点击?

时间:2018-03-07 08:16:31

标签: javascript jquery click

朋友我想这样做: 当我进入网站时自动点击一个点(x,y坐标)。我一直在网上搜索两个月,但我找不到它。请帮帮我?

1 个答案:

答案 0 :(得分:0)

尝试以下java脚本代码,其中x,y是坐标

public func resizeImage(_ image: UIImage, targetWidth: CGFloat) -> UIImage? {
    assert(targetWidth > 0.0)

    let scale = Double(targetWidth) / Double(image.size.width)

    guard let ciImage = CIImage(image: image) else {
        fatalError("Couldn't create CIImage from image in input")
    }

    guard let filter = CIFilter(name: "CILanczosScaleTransform") else {
        fatalError("The filter CILanczosScaleTransform is unavailable on this device.")
    }

    filter.setValue(ciImage, forKey: kCIInputImageKey)
    filter.setValue(scale, forKey: kCIInputScaleKey)

    guard let result = filter.outputImage else {
        fatalError("No output on filter.")
    }

    guard let cgImage = context.createCGImage(result, from: result.extent) else {
        fatalError("Couldn't create CG Image")
    }

    return UIImage(cgImage: cgImage)
}