curl / Mailing Lists / curl-users / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Curl Help?

From: bruce via curl-users <curl-users_at_cool.haxx.se>
Date: Sun, 17 Jan 2021 11:13:35 -0500

Hi. Looking to use test curl to drive a site that's javascript.
Looking for any spare "eyeballs" that might want to toss some ideas my
way.

The test site is a Psoft site:
 https://cmsweb.pscs.calpoly.edu/psc/CSLOPRD/EMPLOYEE/SA/c/COMMUNITY_ACCESS.CLASS_SEARCH.GBL
 https://cmsweb.pscs.calpoly.edu/psp/CSLOPRD/EMPLOYEE/SA/c/COMMUNITY_ACCESS.CLASS_SEARCH.GBL

I've been successful in using curl to "simulate" and drive testing a
few other similar sites. In this situation, the site has a "term"
element that's being driven by a:
  javascript:pAction_win0(document.win0,'SLO_SS_DERIVED_STRM$prompt')

In order to try to craft the "curl" for this. I used the following steps:
-Fire up Firefox v78
 set the developer tools/Network tools
 initiate the url;
  https://cmsweb.pscs.calpoly.edu/psc/CSLOPRD/EMPLOYEE/SA/c/COMMUNITY_ACCESS.CLASS_SEARCH.GBL

 select the "calpoly" as the institution
  clear the network traffic section
 select the "term" icon
 (this generates the 'popup/frame' for the term list)

 my thought was that the post/get curl cmds should then generate the
target "term" content..
 wrong!! -- even though running the curl in a different browser tab
works.. running the
 curl generates the base page. (arrgghh!!)

 now, when I tested this on a few other similar sites.. this process works.
 it appears the difference is in the javascript function.

 In the test sites that work, the javascript function is
  javascript:submit_win0<<<<

  as opposed to

  javascript:pAction_win0


So, if you have a few spare cycles/or are bored and you want to take a
look, I'd greatly appreciate it. I'm missing something and can't quite
see my issue(s).

thanks

ps. I can can easily add the initial curl test processes I'm running.
You'd have to rerun the site/url in the browser to generate your curl
processes with the updated cookies.

-----------------------------------------------------------------------------------------------------


top level/base page::
curl 'https://cmsweb.pscs.calpoly.edu/psc/CSLOPRD/EMPLOYEE/SA/c/COMMUNITY_ACCESS.CLASS_SEARCH.GBL'
-H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0)
Gecko/20100101 Firefox/78.0' -H 'Accept:
text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'
-H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'Referer:
https://cmsweb.pscs.calpoly.edu/psc/CSLOPRD/EMPLOYEE/SA/c/COMMUNITY_ACCESS.CLASS_SEARCH.GBL?&'
-H 'Content-Type: application/x-www-form-urlencoded' -H 'Origin:
https://cmsweb.pscs.calpoly.edu' -H 'Connection: keep-alive' -H
'Cookie: _ga_CY2GPTVZY7=GS1.1.1610859475.2.1.1610859546.0;
_ga=GA1.2.1023496819.1610815178; _gid=GA1.2.527799900.1610815201;
PS_DEVICEFEATURES=width:1366 height:768 pixelratio:1 touch:0
geolocation:1 websockets:1 webworkers:1 datepicker:1 dtpicker:0
timepicker:1 dnd:1 sessionstorage:1 localstorage:1 history:1 canvas:1
svg:1 postmessage:1 hc:0 maf:0; SignOnDefault=SLO_GUEST;
__cfduid=d88be97fa0258972b25a87d28719394db1610859266;
psback=%22%22url%22%3A%22https%3A%2F%2Fcmsweb.pscs.calpoly.edu%2Fpsc%2FCSLOPRD%2FEMPLOYEE%2FSA%2Fc%2FCOMMUNITY_ACCESS.CLASS_SEARCH.GBL%22%20%22label%22%3A%22Class%20Search%22%20%22origin%22%3A%22PIA%22%20%22layout%22%3A%220%22%20%22refurl%22%3A%22https%3A%2F%2Fcmsweb.pscs.calpoly.edu%2Fpsc%2FCSLOPRD%2FEMPLOYEE%2FSA%22%22;
CSLOPRD-PSJSESSIONID=eXAQ9Z4toqnpxI1iiq9EDV4JM8i_NqOH!-2139868271;
TS01efa3ea=012a549ad220f847469be8dab37b85328a8a5bc041441f63cc4a73a7c8dfe018dbe4137f43a1360b90a3e10b76efbc4c073d522244;
TS013b7cf7=012a549ad2eb99519bc8eef7fb10d740aa921f087d158ad5d742c460c3675684eefd233ef0875f54506968a0355f7c63481bc77b0bd780d026c2f000adb7e40dd5a0a6f455ae01ac722cfb208ffa11576f5b8f1ddc112dc44aca34abf32b2b69076d057a66d47ea7923d1b3c2f395bea5bc24046dc6bc38fdefa42ea19fac014674cbd2216f174cbd34ef3d7d3e2f124724c8c618d62ee2e271abc62f8d9ff7df6d19059dad43241b6111c678e483c5894aaa6f301;
ExpirePage=https://cmsweb.pscs.calpoly.edu/psc/CSLOPRD/;
PS_LOGINLIST=https://cmsweb.pscs.calpoly.edu/CSLOPRD;
PS_TOKENEXPIRE=17_Jan_2021_15:30:49_GMT;
PS_TOKEN=pgAAAAQDAgEBAAAAvAIAAAAAAAAsAAAABABTaGRyAk4Acwg4AC4AMQAwABT2ezF2NNW6KOw4VUQUvkgoV4c9Y2YAAAAFAFNkYXRhWnicJYlLDkBAEESfTywt3IOYifisERtBDGuHcD2HU0NX8qq66gbiKAwC+RPyXeaYWbmYOBlxHCQji9605982dgYqS4nFkMs9DbVopUJNK/rGs6FTsiIv2zwMcA==;
PS_TokenSite=https://cmsweb.pscs.calpoly.edu/psc/CSLOPRD/?CSLOPRD-PSJSESSIONID;
PS_LASTSITE=https://cmsweb.pscs.calpoly.edu/psc/CSLOPRD/' -H
'Upgrade-Insecure-Requests: 1' -H 'Cache-Control: max-age=0'
--data-raw 'ICType=Panel&ICElementNum=0&ICStateNum=2&ICAction=&ICModelCancel=0&ICXPos=0&ICYPos=0&ResponsetoDiffFrame=-1&TargetFrameName=None&FacetPath=None&ICFocus=&ICSaveWarningFilter=0&ICChanged=-1&ICSkipPending=0&ICAutoSave=0&ICResubmit=0&ICSID=r7mvj3z%2BhqSXOdHXc7Aunh3m31STmdeBOkf4Y8NZe%2BA%3D&ICActionPrompt=true&ICBcDomData=UnknownValue&ICPanelName=&ICFind=&ICAddCount=&ICAppClsData='


select/generate term "element"
curl 'https://cmsweb.pscs.calpoly.edu/psc/CSLOPRD/EMPLOYEE/SA/c/COMMUNITY_ACCESS.CLASS_SEARCH.GBL'
-H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0)
Gecko/20100101 Firefox/78.0' -H 'Accept: */*' -H 'Accept-Language:
en-US,en;q=0.5' --compressed -H 'Content-Type:
application/x-www-form-urlencoded' -H 'Origin:
https://cmsweb.pscs.calpoly.edu' -H 'Connection: keep-alive' -H
'Referer: https://cmsweb.pscs.calpoly.edu/psc/CSLOPRD/EMPLOYEE/SA/c/COMMUNITY_ACCESS.CLASS_SEARCH.GBL'
-H 'Cookie: _ga_CY2GPTVZY7=GS1.1.1610859475.2.1.1610859546.0;
_ga=GA1.2.1023496819.1610815178; _gid=GA1.2.527799900.1610815201;
PS_DEVICEFEATURES=width:1366 height:768 pixelratio:1 touch:0
geolocation:1 websockets:1 webworkers:1 datepicker:1 dtpicker:0
timepicker:1 dnd:1 sessionstorage:1 localstorage:1 history:1 canvas:1
svg:1 postmessage:1 hc:0 maf:0; SignOnDefault=SLO_GUEST;
__cfduid=d88be97fa0258972b25a87d28719394db1610859266;
psback=%22%22url%22%3A%22https%3A%2F%2Fcmsweb.pscs.calpoly.edu%2Fpsc%2FCSLOPRD%2FEMPLOYEE%2FSA%2Fc%2FCOMMUNITY_ACCESS.CLASS_SEARCH.GBL%22%20%22label%22%3A%22Class%20Search%22%20%22origin%22%3A%22PIA%22%20%22layout%22%3A%220%22%20%22refurl%22%3A%22https%3A%2F%2Fcmsweb.pscs.calpoly.edu%2Fpsc%2FCSLOPRD%2FEMPLOYEE%2FSA%22%22;
CSLOPRD-PSJSESSIONID=LZQRHKU_mqEUpgCPz_F7E2MOKKEhyPuQ!-2139868271;
TS01efa3ea=012a549ad2b9c5408f68e445a25735d52a830e27a406bb87571d18aa71758f45e2ed48ce039b6136320ca6a91b92f97b7a49f956c5;
TS013b7cf7=012a549ad281b1fc52364feb4a8779de16e698d000158ad5d742c460c3675684eefd233ef0d1ad8d8a486e39546c5e43390f059d0bca3304c8409550c3beecd3383cb4b10e03424ef8e20f3e3861b668121ac22f5f7df014b7a73f506796a08d71ca40fb54885b1709ab4ce4ff1f6534fc0091e7d9eb1d9cc6e8e8e5f0510fd2907bbe2d09945871d0c62284466023580e502c32d626bad12bfda0721622a33575a3879e184f2111bf815eefcf78402ef1cf2b8107;
ExpirePage=https://cmsweb.pscs.calpoly.edu/psc/CSLOPRD/;
PS_LOGINLIST=https://cmsweb.pscs.calpoly.edu/CSLOPRD;
PS_TOKENEXPIRE=17_Jan_2021_16:10:59_GMT;
PS_TOKEN=pgAAAAQDAgEBAAAAvAIAAAAAAAAsAAAABABTaGRyAk4Acwg4AC4AMQAwABT2ezF2NNW6KOw4VUQUvkgoV4c9Y2YAAAAFAFNkYXRhWnicJYlLDkBAEESfTywt3IOYifisERtBDGuHcD2HU0NX8qq66gbiKAwC+RPyXeaYWbmYOBlxHCQji9605982dgYqS4nFkMs9DbVopUJNK/rGs6FTsiIv2zwMcA==;
PS_TokenSite=https://cmsweb.pscs.calpoly.edu/psc/CSLOPRD/?CSLOPRD-PSJSESSIONID;
PS_LASTSITE=https://cmsweb.pscs.calpoly.edu/psc/CSLOPRD/; _gat=1'
--data-raw 'ICDoModal=1&ICAJAX=1&ICSPROMPT=1&ICNAVTYPEDROPDOWN=0&ICType=Panel&ICElementNum=0&ICStateNum=2&ICAction=SLO_SS_DERIVED_STRM%24prompt&ICModelCancel=0&ICXPos=0&ICYPos=0&ResponsetoDiffFrame=-1&TargetFrameName=None&FacetPath=None&ICFocus=&ICSaveWarningFilter=0&ICChanged=-1&ICSkipPending=0&ICAutoSave=0&ICResubmit=0&ICSID=zHoVkdnFSsqaOBmyPRRXBZbHsRVopjIeazUAyWkyanQ%3D&ICActionPrompt=true&ICBcDomData=UnknownValue&ICPanelName=&ICFind=&ICAddCount=&ICAppClsData=&CLASS_SRCH_WRK2_INSTITUTION$31$=SLCMP&SLO_SS_DERIVED_STRM=0846'

-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2021-01-17