Digital101 4 Posted January 23, 2015 Report Share Posted January 23, 2015 I am scraping a site and want to show the current category in the UI. Right now I have it showing the category number but that does not really tell the person looking at the bot much of anything. What I want to display is the actual category that matches each number. Been thinking about it a bit and all the ways that come to me seem to be convoluted enough to be somewhat ludicrous and I figure there is probably a fairly simple way I am missing. If someone could point me in the right direction that would be great. Thanks Quote Link to post Share on other sites
Enigma 78 Posted January 23, 2015 Report Share Posted January 23, 2015 How much categories are you talking about? Quote Link to post Share on other sites
HelloInsomnia 1103 Posted January 23, 2015 Report Share Posted January 23, 2015 I think I know what site you're talking about and if I'm right I can't tell you why it's like that since it was a long time ago but probably to save time You can just create a very long if then statement that says if the category number = 20 or whatever number then set a variable to be the name to be the category name which displays in a stat monitor. And of course if its not that number then you use an else if for the rest of the category numbers. Quote Link to post Share on other sites
Digital101 4 Posted January 24, 2015 Author Report Share Posted January 24, 2015 How much categories are you talking about? The one I am looking at now has a dozen but another one I am starting on has 30+ Quote Link to post Share on other sites
Digital101 4 Posted January 24, 2015 Author Report Share Posted January 24, 2015 I think I know what site you're talking about and if I'm right I can't tell you why it's like that since it was a long time ago but probably to save time You can just create a very long if then statement that says if the category number = 20 or whatever number then set a variable to be the name to be the category name which displays in a stat monitor. And of course if its not that number then you use an else if for the rest of the category numbers. I thought of that after I posted and it would work but looking at some larger sites as well and I do not see that scaling all that well without confusing the hell out of me. I was hoping there was something simple that I was over looking. Quote Link to post Share on other sites
HelloInsomnia 1103 Posted January 24, 2015 Report Share Posted January 24, 2015 I thought of that after I posted and it would work but looking at some larger sites as well and I do not see that scaling all that well without confusing the hell out of me. I was hoping there was something simple that I was over looking. There would have to be a category name to be scraped if that doesn't exist you would have to convert it. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.