python-3.x - python中的URL缩短器
问题描述
对于 URL Shortening,我在这里使用了Adfly
. 但我收到类型错误!
from pyshorteners import Shortener
url = "https://www.geeksforgeeks.org/url-shorteners-and-its-api-in-python-set-1/?ref=lbp"
ShortenedURL = Shortener('Adfly' , uid ='24352319' , key='07eb7bf58efa292d99437daddea9496b' , type = 'int')
print("Short URL is {}".format(ShortenedURL.short(url)))
错误 :
TypeError Traceback (most recent call last)
<ipython-input-45-fb2e845d42a4> in <module>
8
9 url = "https://www.geeksforgeeks.org/url-shorteners-and-its-api-in-python-set-1/?ref=lbp"
---> 10 ShortenedURL = Shortener('Adfly' , uid ='24352319' , key='07eb7bf58efa292d99437daddea9496b' , type = 'int' )
11 print("Short URL is {}".format(ShortenedURL.short(url)))
12 get_ipython().run_line_magic('pinfo', 'Shortener')
TypeError: __init__() takes 1 positional argument but 2 were given
我无法区分错误。请帮我。
解决方案
推荐阅读
- javascript - 寻找走出迷宫的方法
- android - 导出 Room 数据库并附加到电子邮件 Android Kotlin
- amazon-s3 - 将数据从关系数据库传输到 S3 时是否保留了关系?
- oracle-sqldeveloper - 为什么我无法使用 Oracle XE 并出现错误:“IO 错误:网络适配器无法建立连接供应商代码 17002”?
- javascript - 嵌入对象到数组
- r - 顶点标签从 id 更改为 igraph 中的另一列
- watchkit - Apple Watch 陀螺仪和方向更新率?
- jestjs - 本地测试运行良好时,可能导致 CI 测试失败的原因是什么?
- hive - Hive 未在 ubuntu java.lang.ClassCastException 上运行
- mysql - 无法使用“127.0.0.1”连接到 Sequel Pro,但可以使用“localhost”通过终端连接