For most of eBay’s history eBay placed a category navigation tree at the top of each listing.
You could quickly determine what category a item was listed in so you could list your item in the same category.
Then eBay moved this to the bottom of the page. The big problem with this was that as you scrolled downward to find the category tree eBay kept generating content (i.e., ads) so that you had to keep scrolling downward or using the page down key multiple times.
Now they moved the category tree within the item specifics; however, on a desktop browser the item specifics section appears below the picture gallery, seller and shipping details and two rows of ads.
I don’t want to waste time searching for this so I saved the following AppleScript on my desktop. It searches for the second occurrence of “Category” on the page and then closes the search box in Chrome.
You can modify this to work for other browsers.
AppleScript exported as app on desktop.
tell application "Google Chrome"
activate
tell application "System Events"
keystroke "G" using command down
delay 1
keystroke "Category"
delay 1
keystroke return
key code 53 --Escape Key
end tell
end tell
Once I see the category tree I copy the link for the category and use the following AppleScript on my desktop to extract the category number and copy it to the computer’s clipboard so I can simply paste it into GS without having to manually navigate to the category.
This works for the main U.S. eBay site. If eBay motors and other sites may use a different URL structure for listings it will not work and will need to be modified.
AppleScript exported as app on desktop.
set theURL to the clipboard
set AppleScript's text item delimiters to "/"
set theTextItems to text items of theURL
set AppleScript's text item delimiters to {""}
set the IsURL to offset of "/" in theURL
set theNumbers to "0123456789"
set theQ to "?"
if IsURL > 1 then
set theCount to count text items of theTextItems
set theItem to item (theCount) of theTextItems
set IsFirstCharText to first character of theItem
if IsFirstCharText is not in theNumbers then
set theItem to item (theCount - 1) of theTextItems
end if
if theItem contains theQ then
set AppleScript's text item delimiters to theQ
set theTextItemsNew to the text items of theItem
set theItem to item 1 of theTextItemsNew
display dialog theItem
end if
get the clipboard
set the clipboard to theItem
end if