[英]How to pass String variable (s_code) to Jsoup pseudo selector " :containsOwn(text) " instead of String value at text, thanks in advance
[英]How to pass cookie value as string instead of Map<String, String> in JSOUP?
我希望使用Jsoup
以編程方式將在開發人員控制台中找到的 cookie 值作為字符串傳遞。
我知道以下在 JSOUP 中傳遞 cookie 的方法
.cookies(login.cookies())
值類型是Map<String, String> var1
但我希望字符串如下,如何實現呢?
-H 'Cookie: currency=INR; magnitude=LC; ad=3d468...' \
-H 'Referer: https://www.valueresearchonline.com/funds/26123/motilal-oswal-flexi-cap-fund-regular-plan/' \
我想,您可以編寫自己的方法,使用 StringBuilder 將 Map<String, String> 轉換為 String。
正如您在屏幕截圖中看到的那樣, cookies 字符串作為名為Cookie
的 header 發送。
如果你已經有了正確的值,你可以直接設置這個 header:
.header("Cookie", "currency=INR; magnitude=LC; ad=3d4686659c9...")
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.