我有一个元组列表(id,url)我需要从URL列表中抓取产品,当这些产品被抓取时,我需要将它们存储在他们的id下的数据库中.
问题是我无法理解如何将id传递给解析函数,以便我可以将已爬行的项目存储在其id下.
我想添加一些下拉列表和输入框,以便使用 django-celery 定期调度 Web ui 添加一些其他内容。
我怎样才能做到这一点。
我期望下面的代码在设置静态变量值的语句之前打印行,但它没有按预期工作.
import java.io.PrintWriter;
class Bank{
private static boolean isInCrisis = false;
public static boolean getIsInCrisis(){return Bank.isInCrisis;}
public static boolean setIsInCrisis(boolean crisis){
return Bank.isInCrisis = crisis;
}
public String getCash() throws Exception{
if(!Bank.isInCrisis){
return new String("$100");
}
else{
throw new Exception("Bank is in crisis");
}
}
}
public class InstanceObjects{
public static void main(String... st) {
try{
Bank hsbc = new Bank();
PrintWriter writer = new PrintWriter(System.out);
writer.printf("collect cash: %s\n",hsbc.getCash());
writer.printf("collect cash: %s\n",hsbc.getCash());
writer.printf("collect cash: %s\n",hsbc.getCash());
writer.printf("collect cash: %s\n",hsbc.getCash());
writer.printf("collect cash: …Run Code Online (Sandbox Code Playgroud)