$get all cookies

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
 
(3 intermediate revisions by one user not shown)
Line 5: Line 5:
  
 
Cookie Name1, Cookie Value1
 
Cookie Name1, Cookie Value1
 +
 
Cookie Name2, Cookie Value2
 
Cookie Name2, Cookie Value2
 +
 
Cookie Name3, Cookie Value3
 
Cookie Name3, Cookie Value3
  
Line 14: Line 16:
 
navigate("http://www.html-kit.com/tools/cookietester/","Wait")
 
navigate("http://www.html-kit.com/tools/cookietester/","Wait")
 
click(<value="Set Test Cookie">,"Left Click","No")
 
click(<value="Set Test Cookie">,"Left Click","No")
set cookie("cookie 1","cookie value 1")
+
set cookie("cookie_1","cookie_value_1")
set cookie("cookie 2","cookie value 2")
+
set cookie("cookie_2","cookie_value_2")
set cookie("cookie 3","cookie value 3")
+
set cookie("cookie_3","cookie_value_3")
 +
click(<value="Refresh">,"Left Click","No")
 +
wait for browser event("Page Loaded","")
 
add list to list(%shopping cookies,$list from text($get all cookies,$new line),"Delete","Global")
 
add list to list(%shopping cookies,$list from text($get all cookies,$new line),"Delete","Global")
  
Line 26: Line 30:
 
When the script is run, the cookies are set both on the page and through UBot Studio, and all 4 cookies are returned to a new line delimited list in UBot Studio.
 
When the script is run, the cookies are set both on the page and through UBot Studio, and all 4 cookies are returned to a new line delimited list in UBot Studio.
  
[[File:getallcookies.jpg]]
+
[[File:getallcookies0.jpg]]

Latest revision as of 13:29, 23 September 2016

This function is a Cookie Control function in the UBot Extended Library found in the bot bank. This function will return all cookies on a website in a list.

The cookies are returned in the following format:

Cookie Name1, Cookie Value1

Cookie Name2, Cookie Value2

Cookie Name3, Cookie Value3

[edit] Example


navigate("http://www.html-kit.com/tools/cookietester/","Wait")
click(<value="Set Test Cookie">,"Left Click","No")
set cookie("cookie_1","cookie_value_1")
set cookie("cookie_2","cookie_value_2")
set cookie("cookie_3","cookie_value_3")
click(<value="Refresh">,"Left Click","No")
wait for browser event("Page Loaded","")
add list to list(%shopping cookies,$list from text($get all cookies,$new line),"Delete","Global")


For this example, the website allows the setting of cookies through the web page. The Set Cookie command is also used to set additional cookies through UBot Studio.

When the script is run, the cookies are set both on the page and through UBot Studio, and all 4 cookies are returned to a new line delimited list in UBot Studio.

Getallcookies0.jpg

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox