为什么我在 Apify 中调用最后一次成功的 运行 时得到 "actor not found"?
why am I getting "actor not found" when calling the last succesful run from an actor in Apify?
我在从 Apify 演员调用最后一次成功 运行 时收到此错误。有人知道为什么吗?我在任何地方都找不到演员 ID,所以我用演员的名字代替。
这是我的 api 电话,希望从我的演员那里获得最后一次成功的乐趣...................................... .........
func getZillowListings() -> Bool {
//@Binding var listingsResults : Bool
let token = "SECRET"
let taskId = "ZE5LuEYvZzcWW0nGA"
let actorId = "zillow-api-scraper"
var urlComponents = URLComponents(string: "https://api.apify.com/v2/acts/\(actorId)/runs/last")
urlComponents?.queryItems = [
URLQueryItem(name: "actorTaskId", value: taskId),
URLQueryItem(name: "token", value: token),
URLQueryItem(name: "status", value: "SUCCEEDED"),
]
let url = urlComponents?.url
if let url = url {
// Create URL Request
var request = URLRequest(url: url, cachePolicy: .reloadIgnoringLocalCacheData, timeoutInterval: 10.0)
request.httpMethod = "GET"
//request.addValue("Bearer \(token)", forHTTPHeaderField: "Authorization")
// Get URLSession
let session = URLSession.shared
// Create Data Task
let dataTask = session.dataTask(with: request) { (data, response, error) in
// Check that there isn't an error
if error == nil {
do {
if data != nil {
let json = try JSONSerialization.jsonObject(with: data!, options:[])
print("Received response")
print(json)
// decode the json to an array of listings
self.listingsZ = try! JSONDecoder().decode([ListingsZillow].self, from: data!)
self.results!.listings.removeAll() {
// }
self.getShortPriceZillow()
}
}
catch {
print(error)
}
}
}
// Start the Data Task
dataTask.resume()
return true
} else {
return false
}
}
对于名称,您必须使用 username~actorname
所以 petr_cermak~zillow-api-scraper
。 ID是x5YtEpoHnmvaaEgoD
我在从 Apify 演员调用最后一次成功 运行 时收到此错误。有人知道为什么吗?我在任何地方都找不到演员 ID,所以我用演员的名字代替。
这是我的 api 电话,希望从我的演员那里获得最后一次成功的乐趣...................................... .........
func getZillowListings() -> Bool {
//@Binding var listingsResults : Bool
let token = "SECRET"
let taskId = "ZE5LuEYvZzcWW0nGA"
let actorId = "zillow-api-scraper"
var urlComponents = URLComponents(string: "https://api.apify.com/v2/acts/\(actorId)/runs/last")
urlComponents?.queryItems = [
URLQueryItem(name: "actorTaskId", value: taskId),
URLQueryItem(name: "token", value: token),
URLQueryItem(name: "status", value: "SUCCEEDED"),
]
let url = urlComponents?.url
if let url = url {
// Create URL Request
var request = URLRequest(url: url, cachePolicy: .reloadIgnoringLocalCacheData, timeoutInterval: 10.0)
request.httpMethod = "GET"
//request.addValue("Bearer \(token)", forHTTPHeaderField: "Authorization")
// Get URLSession
let session = URLSession.shared
// Create Data Task
let dataTask = session.dataTask(with: request) { (data, response, error) in
// Check that there isn't an error
if error == nil {
do {
if data != nil {
let json = try JSONSerialization.jsonObject(with: data!, options:[])
print("Received response")
print(json)
// decode the json to an array of listings
self.listingsZ = try! JSONDecoder().decode([ListingsZillow].self, from: data!)
self.results!.listings.removeAll() {
// }
self.getShortPriceZillow()
}
}
catch {
print(error)
}
}
}
// Start the Data Task
dataTask.resume()
return true
} else {
return false
}
}
对于名称,您必须使用 username~actorname
所以 petr_cermak~zillow-api-scraper
。 ID是x5YtEpoHnmvaaEgoD