小编hye*_*eri的帖子

将 2captcha 与 Python 结合使用

我对 2captchas 和 Python 完全陌生,所以我试图弄清楚这两者是如何工作的。现在我正在编写一个Python脚本并在spyder上运行它来解析图像验证码。我的代码(使用 2captcha API)返回网站的 html 作为返回响应。它尝试注册一个站点,但作为回报,解析验证码的主要任务失败了。我的代码看起来像这样

import requests
from time import sleep

API_KEY = '2captchaapi'  # Your 2captcha API KEY
site_key = '2captcha site key'  # site-key, read the 2captcha docs on how to get this
url = 'site'  # example url
proxy = 'proxy'  # example proxy

proxy = {'http': 'http://' + proxy, 'https': 'https://' + proxy}

s = requests.Session()


# here we post site key to 2captcha to get captcha ID (and we parse it …
Run Code Online (Sandbox Code Playgroud)

python captcha 2captcha

8
推荐指数
1
解决办法
7104
查看次数

将纪元(即 01/01/0001 午夜)转换为 pandas 中的 DateTime

我有一列包含一系列时间戳的列。最初我认为它们在 Unix 时间戳系统中,所以我使用以下代码将它们转换为日期时间。

big_frame['date'] = pd.to_datetime(big_frame['filename'],unit='s')
Run Code Online (Sandbox Code Playgroud)

然而,它给了我奇怪的结果,所以我研究了更多,发现时间戳基本上使用 .net 纪元,即 01/01/0001 午夜。所以文件名是从那个时代开始的秒数。如何将数据框中的列转换为正确的日期时间?

例如,如果我有这个

63730342900 
Run Code Online (Sandbox Code Playgroud)

结果应该是

14/07/2020 17:01:40
Run Code Online (Sandbox Code Playgroud)

编辑:

https://www.epochconverter.com/seconds-days-since-y0

这是我能找到的唯一正确转换上述时间戳的网站

下面是我要转换的列

0     63729045145
1     63729045145
2     63729045146
3     63729045146
4     63729045146
5     63729045147
6     63729045147
7     63729045147
Run Code Online (Sandbox Code Playgroud)

python pandas

7
推荐指数
1
解决办法
439
查看次数

错误(19,0)未找到Gradle DSL方法:android()

我刚刚升级了android studio,之前编译的项目现在显示错误!

错误(19,0)未找到Gradle DSL方法:android()

,这是构建脚本和app.build.gradle

buildscript {
repositories {
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:1.0.0'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}
  }
    allprojects {
      repositories {
    jcenter()
}
}

   android {
    defaultConfig {
    minSdkVersion 8
    targetSdkVersion 22
}
productFlavors {
}
  }

 dependencies {
}
Run Code Online (Sandbox Code Playgroud)

这是build.gradle

 apply plugin: 'com.android.application'

  android {
compileSdkVersion 21
buildToolsVersion "21.1.2"

defaultConfig {
    applicationId "com.aqsa.personal.newpro"
    minSdkVersion 8
    targetSdkVersion 22
    versionCode …
Run Code Online (Sandbox Code Playgroud)

android android-gradle-plugin

3
推荐指数
1
解决办法
4671
查看次数