Help with curl command


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help with curl command
# 1  
Old 09-12-2014
Help with curl command

HI I am trying to write a script where i can enter a dvd's bar code at the cli and return the price sites will pay for the dvd.

the bard code im using for testing is

Quote:
8717418242275
this site is



through use of httpfox i have found some info whic i need to use with curl

Code:
ctl00$ScriptManager1 ctl00$upGetValue|ctl00$btnGetValue
ctl00$txtBarcode 8717418242275
ctl00$ContentPlaceHolder1$hndMinItem 10
ctl00$ContentPlaceHolder1$hndMaxItem 500
ctl00$ContentPlaceHolder1$hndMinPrice
ctl00$ContentPlaceHolder1$hndMaxPrice
ctl00$ContentPlaceHolder1$hndMaxSalesRank
ctl00$ContentPlaceHolder1$hndMaxDupItems 1
ctl00$ContentPlaceHolder1$hndGridItemCount 1
__LASTFOCUS
__EVENTTARGET
__EVENTARGUMENT
__VIEWSTATE /wEPDwUJLTU3ODM4OTEyD2QWAmYPZBYCAgQPZBYIAgMPFgIeB1Zpc2libGVnFgICAQ8PFgIfAGdkFgoCAQ8WAh8AZ2QCAw8WAh8AZ2QCBQ8WAh8AZ2QCCQ8WAh8AaGQCCw8WAh8AZ2QCBw9kFgJmD2QWAgIBDw9kFgIeCm9ua2V5cHJlc3MFKHJldHVybiBjb250cm9sRW50ZXIoJ2N0bDAwX2J0bkdldFZhbHVlJylkAggPFQ0NL0RlZmF1bHQuYXNweBAvc3RhcnQtaGVyZS5hc3B4Fi9ob3ctaXQtYWxsLXdvcmtzLmFzcHgPL3NlbGwtZHZkcy5hc3B4EC9zZWxsLWdhbWVzLmFzcHgOL3NlbGwtY2RzLmFzcHgWL0Nhc2gtZm9yLW1vYmlsZXMuYXNweA4vYWJvdXQtdXMuYXNweAkvZmFxLmFzcHgPL2NvbnRhY3R1cy5hc3B4BS9ibG9nHi9TZW5kaW5nWW91ckl0ZW1zVG9Vc0ZyZWUuYXNweA0vYmxvZy9zaXRlbWFwZAIJD2QWAmYPZBYCZg9kFgwCAQ8PFgIeBFRleHRlZGQCAw8PFgIfAmVkZAIFDzwrABEDAA8WBB4LXyFEYXRhQm91bmRnHgtfIUl0ZW1Db3VudGZkARAWABYAFgAMFCsAAGQCCQ8PZBYCHgdvbmNsaWNrBT1qYXZhc2NyaXB0OnJldHVybiBDaGVja0lmVXNlckxvZ2dlZEluRm9yU2F2aW5nT3JkZXIoJ0ZhbHNlJyk7ZAILD2QWAmYPD2QWAh8FBTFqYXZhc2NyaXB0OnJldHVybiBDaGVja1Rlcm1BbmRDb25kaXRpb24oJ0ZhbHNlJyk7ZAIMDxUBGi90ZXJtcy1hbmQtY29uZGl0aW9ucy5hc3B4ZBgCBR5fX0NvbnRyb2xzUmVxdWlyZVBvc3RCYWNrS2V5X18WAQUuY3RsMDAkQ29udGVudFBsYWNlSG9sZGVyMSRjaGtUZXJtc0FuZENvbmRpdGlvbgUmY3RsMDAkQ29udGVudFBsYWNlSG9sZGVyMSRndkVhbk51bWJlcnMPPCsADAIGFQEQT1JERVJfREVUQUlMU19JRAhmZA==
__ASYNCPOST true
ctl00$btnGetValue

can any one advise me how to formulate a curl command with the relevant info which will return the page containing the price offered for the dvd ?

any help at all would be appreciated


Pete

Last edited by dunryc; 09-12-2014 at 06:15 PM..
# 2  
Old 09-12-2014
They use javascript, form variables, and cookies in combination. Does not look straightforward.
This User Gave Thanks to Corona688 For This Post:
# 3  
Old 09-12-2014
thanks Corona688
can you think of any other ways to accomplist this from the cli ?

with the following command

Code:
curl --data "ctl00%24ScriptManager1=ctl00%24upGetValue%7Cctl00%24btnGetValue&ctl00%24txtBarcode=871741824227&ctl00%24ContentPlaceHolder1%24hndMinItem=10&ctl00%24ContentPlaceHolder1%24hndMaxItem=500&ctl00%24ContentPlaceHolder1%24hndMinPrice=&ctl00%24ContentPlaceHolder1%24hndMaxPrice=&ctl00%24ContentPlaceHolder1%24hndMaxSalesRank=&ctl00%24ContentPlaceHolder1%24hndMaxDupItems=1&ctl00%24ContentPlaceHolder1%24hndGridItemCount=0&__LASTFOCUS=&__EVENTTAR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RpdGlvbignRmFsc2UnKTtkAgwPFQEaL3Rlcm1zLWFuZC1jb25kaXRpb25zLmFzcHhkGAIFHl9fQ29udHJvbHNSZXF1aXJlUG9zdEJhY2tLZXlfXxYBBS5jdGwwMCRDb250ZW50UGxhY2VIb2xkZXIxJGNoa1Rlcm1zQW5kQ29uZGl0aW9uBSZjdGwwMCRDb250ZW50UGxhY2VIb2xkZXIxJGd2RWFuTnVtYmVycw88KwAMAgYVARBPUkRFUl9ERVRBSUxTX0lECGZk&__ASYNCPOST=true&ctl00%24btnGetValue=true" hxxp://www.webuydvds.co.uk/start-here.aspx

i get the following error

Code:
179|error|500|The page is performing an async postback but the ScriptManager.SupportsPartialRendering property is set to false. Ensure that the property is set to true during an async postback.

Smilie


Dunryc
# 4  
Old 09-12-2014
Use the site like you would a web browser.

Visit the main page, let it set and keep cookies, get the relevant hidden variables, send the cookie when you make the POST.
# 5  
Old 09-13-2014
any heads up or pointers on how i accomplish that ?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Web Development

Curl Command Error

Good afternnon. I need your help please to understand the basics of curl command to test web services. Ive heard i can test a web service using this command,so: curl http://glb_osb_fs.nh.inet:7110/serverglobal/services/StrategicPlanning/NotifyMNPAction_v1 it yields some errors, i would... (5 Replies)
Discussion started by: alexcol
5 Replies

2. Shell Programming and Scripting

Using CURL command with special characters in URL

Hi. I 'm trying to hit a REST api and retrieve a JSON feed, and the URL has special characters in it. Something like: Example Domain The below curl command is failing curl -X GET https://www.example.com/?sample=name&id=1001 saying bad command at id=1001 I am going to use this as part... (3 Replies)
Discussion started by: kumarjt
3 Replies

3. Shell Programming and Scripting

Alternative command/method to curl

is there a different way to do the following: curl -k -H "Content-Type:application/json" -X POST -d'{"api_token": "33blah526c-6bla71-441b-491b-0blahca08"}' https://10.10.10.10/api/1.4/auth/session -c /tmp/myhost01.myhost.com im seeking to use a different method because i'm running into TLS... (1 Reply)
Discussion started by: SkySmart
1 Replies

4. Shell Programming and Scripting

Curl command to post headers

I am trying post SOAP header from file to curl command. The curl command is curl -vk -H "$(cat curl-test1.txt)" -X POST https://xvcfvusdgfsd.sdfjd.gf/cmsws/CMSService The contet of curl file is POST: https://cmsuat.chrysler.com/cmsusws/CMSService HTTP/1.1 SOAPAction:... (1 Reply)
Discussion started by: dineshaila
1 Replies

5. Shell Programming and Scripting

Curl command

Hi All, I am using below curl commad and getting output data correctly curl -k -u AASSDD:PPOOII -d "output_mode=csv" --data-urlencode search='search source=*/AASSDDFF/PPOOLLKK**/94.0*ASD-RST* "Caused by" OR "Error: LISTENER WILL BE DISABLED" OR java.lang.reflect.InvocationTargetException |... (1 Reply)
Discussion started by: rakeshtomar82
1 Replies

6. HP-UX

CURL command in HPUX

Hi, I do not find curl command in HPUX. I used to use curl command in solaris to download files onto the server using the below command. /opt/boksm/lib/curl http://mymachine.net:9191/faci/TSDM\$dm-orbeon/artifact/my-ear.zip -o my-ear.zip If not curl how can the same be achived... (4 Replies)
Discussion started by: mohtashims
4 Replies

7. Shell Programming and Scripting

Is curl command secure

Can any one confirm that posting username and password using curl command to "https" site is secure or not. Thanks, (1 Reply)
Discussion started by: Anjan1
1 Replies

8. Shell Programming and Scripting

Authentication using Curl command

Hi, I am using linux curl command to login to the website. Website is using http protocol. My question is how to protect "username and password" while posting the data to the website to avoid man in the middle attack. Is posting the sensitive data(password) using curl is secure?. Is digest... (6 Replies)
Discussion started by: Anjan1
6 Replies

9. UNIX for Dummies Questions & Answers

curl command with web pages

I can't quite seem to understand what the curl command does with a web address. I tried this: curl O'Reilly Media: Tech Books, Conferences, Courses, News but I just got the first few lines of a web page, and it's nowhere on my machine. Can someone elaborate? (2 Replies)
Discussion started by: Straitsfan
2 Replies

10. Shell Programming and Scripting

Curl command

Hello, I try to take out of the command curl the info of the time... time curl --write \"Downloaded %{time total}\" -o ...... but having some problem. (1 Reply)
Discussion started by: protocomm
1 Replies
Login or Register to Ask a Question