We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
启动时,想将某个参数传到Processor中,但是发现根本获取不到,这个是什么原因?代码如下: `Request request = new Request("https:/www.xxxx.xxxx/xxx"); request.setRequestBody(HttpRequestBody.json("{'id':1}","utf-8"));
Spider.create(douyinProcessor).thread(1) .addPipeline(douyinPipeline) .setDownloader(douyinDownloader) .addRequest(request) .runAsync();`
后面代码在Processor中获取,获取不到前面的id值 Request request = page.getRequest(); String paramJson = new String(request.getRequestBody().getBody());
Request request = page.getRequest(); String paramJson = new String(request.getRequestBody().getBody());
获取不到前面传的body里边的内容呢,body是空的,用了request.putExtra方式也传不了。
The text was updated successfully, but these errors were encountered:
在douyinDownloader里处理错了?
douyinDownloader
Sorry, something went wrong.
可以换种方式 Spider.create( new douyinProcessor(id) ).thread(1) ....然后在 douyinProcessor 构造方法中读取id
No branches or pull requests
启动时,想将某个参数传到Processor中,但是发现根本获取不到,这个是什么原因?代码如下:
`Request request = new Request("https:/www.xxxx.xxxx/xxx");
request.setRequestBody(HttpRequestBody.json("{'id':1}","utf-8"));
后面代码在Processor中获取,获取不到前面的id值
Request request = page.getRequest(); String paramJson = new String(request.getRequestBody().getBody());
获取不到前面传的body里边的内容呢,body是空的,用了request.putExtra方式也传不了。
The text was updated successfully, but these errors were encountered: