如果访问太频繁就会被封IP,那么可以在自定义函数外面嵌套Function.InvokeAfter,设置每爬一次停顿个5秒。
比如= Function.InvokeAfter(()=>1+1,#duration(0,0,0,5)),这个要怎么写
以下为我写的网抓sina财经上市公司利润表的函数
(id as text,p as number) as table =>
let
Source = Web.Page(Web.Contents("https://money.finance.sina.com.cn/corp/go.php/vFD_ProfitStatement/stockid/"&id&"/ctrl/" & (Number.ToText(p)) & "/displaytype/4.phtml")),
Data8 = Source{8}[Data],
"Added Index" = Table.AddIndexColumn(Data8, "Index", 0, 1)
in
"Added Index"