[Script] Attempting to modify a script.

Discussion in 'mTurk Scripts & Resources' started by SmokedKipper, Aug 24, 2018.

  1. SmokedKipper

    SmokedKipper Survey Slinger

    Messages:
    1,402
    Gender:
    Male
    Ratings:
    +2,207
    I saw some of the a9's up again and thought i would try to modify a script from the last batch.
    Sadly i have had no luck. for the a9's up right now i tried

    // ==/UserScript==

    document.querySelector('input[id=waterfall[value=NoWaterfall]').click();
    document.querySelector('input[id=double-brested][value=Nodouble-brested]').click();
    document.querySelector('input[id=hood][value=NoHood]').click();
    document.getElementById('submitButton').focus();

    Sorry to pester.
    any tips would be great. TY
     
    • Today I Learned Today I Learned x 1
  2. slothbear

    slothbear Survey Slinger

    Messages:
    10,821
    Gender:
    Male
    Ratings:
    +22,069
    It looks like you might be missing some quotation marks and brackets. Also, it looks the id is wrong on some of those.

    Code:
    document.querySelector('[value="NoWaterfall"]').click();
    document.querySelector('[value="NoDoubleBreasted"]').click();
    document.querySelector('[value="NoHood"]').click();
    document.getElementById('submitButton').focus();
    
    You don't really need as much info as you gave with querySelector because it grabs all the elements of the page and searches through them trying to match stuff. You don't have it give it everything about the element you're looking for, just part of it. That could lead to problems though, because radio buttons, checkboxes, etc... could share a name or value or whatever.
     
    • Today I Learned Today I Learned x 2
  3. SmokedKipper

    SmokedKipper Survey Slinger

    Messages:
    1,402
    Gender:
    Male
    Ratings:
    +2,207
    Crap they are missing, Ty kindly @slothbear
    I think i should start with some basics before i try editing other scripts.
     
  4. slothbear

    slothbear Survey Slinger

    Messages:
    10,821
    Gender:
    Male
    Ratings:
    +22,069
    No problem. Do you use MTS? That helped me work on learning to script because it saves the HIT's source page so you can go back and work on it later. Also, I think messing with other people's scripts is a great way to learn.
     
  5. spamsquirrel

    spamsquirrel New Turker

    Messages:
    3
    Gender:
    Male
    Ratings:
    +1
    Sorry know this is an old post, but how do you get the saved source page from mts?
     
  6. Ornac

    Ornac Survey Slinger TurkerView Masters

    Messages:
    8,739
    Gender:
    Male
    Ratings:
    +11,092
    Find the hit you're looking for in HIT Tracker and it's the Src button next to the hit title.

    upload_2019-2-3_8-1-47.png
     
    • Like Like x 1
  7. spamsquirrel

    spamsquirrel New Turker

    Messages:
    3
    Gender:
    Male
    Ratings:
    +1
    Weird , I don't have that button .
     
  8. Ornac

    Ornac Survey Slinger TurkerView Masters

    Messages:
    8,739
    Gender:
    Male
    Ratings:
    +11,092
    That is odd, hopefully someone with more experience can chime in. It's been there for as long as I can recall, but my first thought is to make sure your MTS is up to date. My second thought would be, maybe it stores them in such a way so that clearing you cookies or some other browser setting deletes them? See if it's there for something you've done recently. If you've got more than 5k approved it doesn't take long to scoop up a

    Title: Are these receipts the same? | PANDA
    Requester: Ibotta Turk [AGVV5AWLJY7H2]
    TurkerView: [ $5.58 / hour ]
    Description: Tell us if two receipts are the same
    Duration: 6 Min
    Available: 1
    Reward: $0.01
    Qualifications:
    • HIT approval rate (%) GreaterThan 95
    • Total approved HITs GreaterThan 5000
    [3BH1IVA3VJXE20OLEULG3K8PC6Q1RU]
     
    • Like Like x 1
  9. spamsquirrel

    spamsquirrel New Turker

    Messages:
    3
    Gender:
    Male
    Ratings:
    +1
    I figured it out . I had to go to the requester overview first then click view then it showed the list of hits and the first one had the src button. Thanks for the help.
     
    • Like Like x 1