Querying Wikipedia data is nowadays done via its structured data counterpart, Wikidata. https://www.wikidata.org/wiki/Wikidata:Data_access
You can for instance use WDQ to get a list of items which are marked as "being" or "having profession of" "writer": http://tools.wmflabs.org/autolist/autolist1.html?q=tree%5B36180%5D%5B%5D%5B31%2C106%5D (60k results).
Or also include all the subclasses thereof (poet and whatever): http://tools.wmflabs.org/autolist/autolist1.html?q=tree%5B36180%5D%5B%5D%5B31%2C106%2C279%5D (gets a bit messy with 200k results, would need some filtering).